summaryrefslogtreecommitdiff
path: root/python/vyos/debug.py
diff options
context:
space:
mode:
authorThomas Mangin <thomas.mangin@exa.net.uk>2020-05-07 00:50:44 +0100
committerThomas Mangin <thomas.mangin@exa.net.uk>2020-05-07 00:50:44 +0100
commit367094ff1764116089c9359e1e949db781a4a0da (patch)
treecf3135162c8a57af652f027805d1d4a9d63cbca0 /python/vyos/debug.py
parente9516e73796bbbda1be76e3f8b5d83cd84070830 (diff)
parented22334321d3b6f27b5d695a4f984257b909f78b (diff)
downloadvyos-1x-367094ff1764116089c9359e1e949db781a4a0da.tar.gz
vyos-1x-367094ff1764116089c9359e1e949db781a4a0da.zip
debug: T1230: add time information to saved debug logs
Diffstat (limited to 'python/vyos/debug.py')
-rw-r--r--python/vyos/debug.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/python/vyos/debug.py b/python/vyos/debug.py
index 60e5291c1..6ce42b173 100644
--- a/python/vyos/debug.py
+++ b/python/vyos/debug.py
@@ -86,10 +86,17 @@ def _timed(message):
return f'{now} {message}'
+def _remove_invisible(string):
+ for char in ('\0', '\a', '\b', '\f', '\v'):
+ string = string.replace(char, '')
+ return string
+
+
def _format(flag, message):
"""
format a log message
"""
+ message = _remove_invisible(message)
return f'DEBUG/{flag.upper():<7} {message}\n'