diff --git a/src/python/jw/pkg/lib/log.py b/src/python/jw/pkg/lib/log.py index 57f38b09..0c6276f2 100644 --- a/src/python/jw/pkg/lib/log.py +++ b/src/python/jw/pkg/lib/log.py @@ -229,13 +229,14 @@ def log( # export margs = '' if len(args): - for i, a in enumerate(args): - margs += (' ' if (i or (msg and not msg.endswith(' '))) else '') + str(a) + margs = ' '.join(str(a) for a in args) if only_printable: margs = _special_char_regex.sub( lambda mo: _special_chars[mo.string[mo.start():mo.end()]], margs ) margs = re.sub('[\x01-\x1f]', '.', margs) + if msg and not msg.endswith(' '): + margs = ' ' + margs for file in _log_file_streams: print(msg + _clean_log_prefix + margs, file = file)