-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
log files are not valid json format #325
Comments
I came across this issue as well, when I need to read the history file and do some plots or analysis. I think a simple solution for the meantime is using something like this:
I think the main issue here is that
To fix this, the code would have to be rewritten to first read the history.json file, and add a new entry. Apparently, you need to load a json file before you append to it (https://stackoverflow.com/questions/45869039/appending-data-to-json-file-with-python). |
Hmm I see. So basically each new entry would be a valid json file but the aggregate of these is not. That is annoying (but it does explain why a while ago I couldn't get json highlighting to work properly!).
A fourth option:
All things considered my vote would be for 2 followed by 4. |
Option 2 sounds good. Maybe |
It is a small issue, but annoying non the less. When I try to commit a json log file, it gets flagged by the json5 pre-commit hook.
Possible solutions:
[
on first opening of the file. And on subsequent writes start with a,
. After the last write do a]
.The text was updated successfully, but these errors were encountered: