Skip to content
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

[Bug]: JSON formatter doesn't escape message #6

Open
beeb opened this issue Oct 6, 2023 · 1 comment
Open

[Bug]: JSON formatter doesn't escape message #6

beeb opened this issue Oct 6, 2023 · 1 comment

Comments

@beeb
Copy link
Contributor

beeb commented Oct 6, 2023

When trying to log to JSON format a message that contains e.g. the debug representation of a struct, the double quotes are not escaped a leads to invalid JSON output.

I suspect other things need to be escaped in the message to generate valid JSON, and I would suggest to defer this to a proper JSON library like serde_json (the industry standard) or tinyjson (never tested myself but fewer deps).

@sdnts
Copy link
Owner

sdnts commented Oct 6, 2023

Thanks for reporting this! Yeah let me look into this as soon as I can!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants