The current JSONLogger implementation writes a new root JST object for each change of IOScope configuration. This leads to a file stream containing multiple JSON objects, which is forbidden by the Python JSON decoder:
>>> jst = json.loads(jstr)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 367, in decode
raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 97 column 1 - line 1140 column 1 (char 1957 - 22085)
Removing all but a single JST object allows the load to succeed:
The current
JSONLogger
implementation writes a new root JST object for each change ofIOScope
configuration. This leads to a file stream containing multiple JSON objects, which is forbidden by the Python JSON decoder:Removing all but a single JST object allows the load to succeed:
Fix this by wrapping each successive
jst
dictionary object inside an array so that the load returns an array of all available JST instances.