summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 1a042cbb4..91431a7bb 100644
--- a/python/vyos/debug.py
+++ b/python/vyos/debug.py
@@ -81,10 +81,17 @@ def enabled(flag):
return _fromenv(flag) or _fromfile(flag)
+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'