Send raylet error logs through the log monitor (#5351)

This commit is contained in:
Eric Liang
2019-08-05 23:35:09 -07:00
committed by GitHub
parent a08ea09760
commit 0a3ff489fa
3 changed files with 38 additions and 5 deletions
+9 -2
View File
@@ -1594,15 +1594,22 @@ def print_logs(redis_client, threads_stopped):
num_consecutive_messages_received += 1
data = json.loads(ray.utils.decode(msg["data"]))
def color_for(data):
if data["pid"] == "raylet":
return colorama.Fore.YELLOW
else:
return colorama.Fore.CYAN
if data["ip"] == localhost:
for line in data["lines"]:
print("{}{}(pid={}){} {}".format(
colorama.Style.DIM, colorama.Fore.CYAN, data["pid"],
colorama.Style.DIM, color_for(data), data["pid"],
colorama.Style.RESET_ALL, line))
else:
for line in data["lines"]:
print("{}{}(pid={}, ip={}){} {}".format(
colorama.Style.DIM, colorama.Fore.CYAN, data["pid"],
colorama.Style.DIM, color_for(data), data["pid"],
data["ip"], colorama.Style.RESET_ALL, line))
if (num_consecutive_messages_received % 100 == 0