-
Notifications
You must be signed in to change notification settings - Fork 734
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
feat: json log format #1791
base: unstable
Are you sure you want to change the base?
feat: json log format #1791
Conversation
cea0da3
to
d8edd52
Compare
Edit: Fixed. I think it was complaining about using the wrong representation of |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #1791 +/- ##
============================================
- Coverage 71.17% 70.94% -0.24%
============================================
Files 123 123
Lines 65641 65650 +9
============================================
- Hits 46720 46573 -147
- Misses 18921 19077 +156
|
4acc3af
to
40b9e16
Compare
Introduce a json log format that can be invoked by passing `log-format json` in your config. Signed-off-by: Johan Bergström <[email protected]>
40b9e16
to
c4b19ab
Compare
Nice to see this has been started. We need to escape the strings. There's some code for that in cli_common.c:
We could move it to another file like util.c, since it will no longer be only for the CLI. |
Makes sense. Would be much more comfortable if I could test this as we go. Should we start a unit test for basic functions? |
Yes, we can do that. Another option is to add an integration test where do something that causes something to be logged and then verify what's logged in the log file. Grep for We can use the command |
Warning
This is a work in progress. Do not merge.
Took a stab at introducing a log format. Any input for how to test this (couldn't find any tests for logfmt) would be much appreciated. If not, should be ok to land.
Todo
Introduce a json log format that can be invoked by passing
log-format json
in your config.Closes: #1006