From 33554ecb065b0090a4ab409ba28a8dae1e67c26f Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Fri, 20 Mar 2020 16:08:09 -0700 Subject: [PATCH] Print prettier androidLog messages old-commit-hash: f468ad3298c631b50def1ea01118333ff535c8f5 --- selfdrive/debug/filter_log_message.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/selfdrive/debug/filter_log_message.py b/selfdrive/debug/filter_log_message.py index 0438dba7b..21eff887d 100755 --- a/selfdrive/debug/filter_log_message.py +++ b/selfdrive/debug/filter_log_message.py @@ -14,6 +14,15 @@ LEVELS = { "CRITICAL": 50, } +ANDROID_LOG_SOURCE = { + 0: "MAIN", + 1: "RADIO", + 2: "EVENTS", + 3: "SYSTEM", + 4: "CRASH", + 5: "KERNEL", +} + if __name__ == "__main__": @@ -41,5 +50,6 @@ if __name__ == "__main__": if sm.updated['androidLogEntry']: t = sm.logMonoTime['androidLogEntry'] - print(f"[{t / 1e9:.6f}] - ") - print(sm['androidLogEntry']) + m = sm['androidLogEntry'] + source = ANDROID_LOG_SOURCE[m.id] + print(f"[{t / 1e9:.6f}] {source} {m.pid} {m.tag} - {m.message}")