mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 00:39:32 +08:00
Send raylet error logs through the log monitor (#5351)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user