Skip to content

Commit 3943242

Browse files
committed
colors in traces
1 parent 5b80767 commit 3943242

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/meshcore_cli/meshcore_cli.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1720,7 +1720,14 @@ async def next_cmd(mc, cmds, json_output=False):
17201720
print("Self]",end="")
17211721
for t in ev.payload["path"]:
17221722
print("→",end="")
1723-
print(f"{t['snr']:.2f}",end="")
1723+
snr = t['snr']
1724+
if snr >= 10 :
1725+
print(ANSI_GREEN, end="")
1726+
elif snr <= 0:
1727+
print(ANSI_RED, end="")
1728+
print(f"{snr:.2f}",end="")
1729+
if snr >= 10 or snr <= 0:
1730+
print(ANSI_END, end="")
17241731
print("→",end="")
17251732
if "hash" in t:
17261733
print(f"[{t['hash']}]",end="")

0 commit comments

Comments
 (0)