Commit 6c04ee3ea292fc0f2e21951f181d308691ba4487

Authored by Christian Herdtweck
1 parent 49e13337

logger: replace newline in messages with simple space

pypy's json loader does not accept newlines in strings
oletools/common/log_helper/_json_formatter.py
... ... @@ -18,7 +18,7 @@ class JsonFormatter(logging.Formatter):
18 18 ensures that there is a `type` field in the record. Otherwise will have
19 19 to add a try-except around the access to `record.type`.
20 20 """
21   - json_dict = dict(msg=record.msg, level=record.levelname)
  21 + json_dict = dict(msg=record.msg.replace('\n', ' '), level=record.levelname)
22 22 json_dict['type'] = record.type
23 23 formatted_message = ' ' + json.dumps(json_dict)
24 24  
... ...