From 9bfcb942dccfcd062ee20537c8981aa53cea543f Mon Sep 17 00:00:00 2001 From: chenzitai Date: Mon, 30 Jul 2018 16:34:53 +0100 Subject: [PATCH] Add Color to Note (cherry picked from commit 2ef5769) --- Software/chamlog.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Software/chamlog.py b/Software/chamlog.py index da4281a..5bece7a 100755 --- a/Software/chamlog.py +++ b/Software/chamlog.py @@ -19,11 +19,12 @@ def verboseLog(text): def formatText(log): formatString = '{timestamp:0>5d} ms <{deltaTimestamp:>+6d} ms>:' - formatString += '{eventName:<28} ({dataLength:<3} bytes)\t[{data:<20}]\t{note}\n' - text = '' - - for logEntry in log: + formatString += '{eventName:<28} ({dataLength:<3} bytes) [{data:<20}] ' \ + '\033[94m {note} \x1b[0m \n' + text = '' + + for logEntry in log: text += formatString.format(**logEntry) return text