Use logger for debug output

Using simple print statements was annoying (lack of timing info and
formatting), so move to using the debug logger for these instead with a
custom state ('d') with white text to differentiate them. Also indicate
which subthread of the keepalive each task is being executed in for
easier tracing of issues.
This commit is contained in:
2020-08-17 12:46:52 -04:00
parent 15e78aa9f0
commit 553f96e7ef
2 changed files with 31 additions and 31 deletions

View File

@ -29,11 +29,12 @@ class Logger(object):
# ANSII colours for output
fmt_red = '\033[91m'
fmt_blue = '\033[94m'
fmt_cyan = '\033[96m'
fmt_green = '\033[92m'
fmt_yellow = '\033[93m'
fmt_blue = '\033[94m'
fmt_purple = '\033[95m'
fmt_cyan = '\033[96m'
fmt_white = '\033[97m'
fmt_bold = '\033[1m'
fmt_end = '\033[0m'
@ -49,6 +50,7 @@ class Logger(object):
't': { 'colour': fmt_purple, 'prompt': '>>> ' },
'i': { 'colour': fmt_blue, 'prompt': '>>> ' },
's': { 'colour': fmt_cyan, 'prompt': '>>> ' },
'd': { 'colour': fmt_white, 'prompt': '>>> ' },
'x': { 'colour': last_colour, 'prompt': last_prompt }
}
format_map_textual = {
@ -59,6 +61,7 @@ class Logger(object):
't': { 'colour': '', 'prompt': 'tick: ' },
'i': { 'colour': '', 'prompt': 'info: ' },
's': { 'colour': '', 'prompt': 'system: ' },
'd': { 'colour': '', 'prompt': 'debug: ' },
'x': { 'colour': '', 'prompt': last_prompt }
}