-
Notifications
You must be signed in to change notification settings - Fork 7
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
issue [null] null: null
maybe caused by structlog or colorama
#106
Comments
Ok I think I see why, it wasn't quite clear form the docs that there were reserved keywords in the log event (level, timestamp, message) and so that's why they are all null for me Perhaps allow a option to disable formatting in the plugin? ie then I can leave the formatting up to myself? Also perhaps make timestamp and level optional |
@fraser-langton Thank you for reporting the issue! As you say, the display of Normally, this plugin only tries to format and display when the entire line is JSON. However, perhaps due to the ANSI color code, it may not be able to correctly recognize the line break. It is difficult to fundamentally fix this behavior, but it is possible to temporarily disable the formatting from the console context menu. Is this a solution for you? ![]() |
I found even turning off colours didn't fix it, it then just displayed the json raw
however adding a ansi reset all char before each log fixed it, i made a structlog processor def pretty_json_log(logger: WrappedLogger, name: str, event: str) -> str:
return f"{_ColorfulStyles.reset}{event}" |
When the plugin is disabled the
[null] null: null
text does not show, thought maybe it was from colorama using the ansi chars. I did a few things to try and fix like ensuring a reset ansi character was before the json but that didn't help. I tried adding a new line, but that stopped the json folding working at all.here is some raw ansi that caused the issue
I checked and the ansi looks valid and should have this effect (I used xml like tags to illustrate)
The text was updated successfully, but these errors were encountered: