-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Format console encoder fields as key=value #1188
base: master
Are you sure you want to change the base?
Conversation
Delighted to find this PR just as I was looking for a way to format key/value data in a more friendly way in the console encoder. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1188 +/- ##
==========================================
- Coverage 98.25% 97.79% -0.47%
==========================================
Files 49 49
Lines 2180 2221 +41
==========================================
+ Hits 2142 2172 +30
- Misses 29 37 +8
- Partials 9 12 +3 ☔ View full report in Codecov by Sentry. |
Any ideas behind the linting failure? I got it locally too after pulling in the latest changes from main, but it's unrelated to any of the files I changed: https://github.com/uber-go/zap/actions/runs/3280798463/jobs/5425117446
|
Thanks for the PR! This is something that's been on our minds as well. We'll review over the next couple of days.
I haven't had a chance to look, but it looks like either (a) an unformatted whitespace change existed before or (b) something subtle has changed upstream since. Not a big deal. |
Any update here? this would be very usefull. |
Anything I need to do to get this moving along? |
Hey, I don't represent the Zap maintainers anymore, but I recall that one of the problems with the proposed changes was that the result wouldn't be fully one format. It would be a mix of logfmt-style and JSON output and that wasn't quite right. However, inspired by this PR, I made an attempt at something that would cover all cases--printing everything in a logfmt-style format (although not to-spec). I hadn't fully ironed out the details before I moved on from the project, but the work is available in this branch. It's super rough and it has many issues: there's duplication, no consideration for performance, and tests are nonexistent. I may make time to pick it up again, but meanwhile if someone else would like to have a go at it, I think the shape of the solution in that branch might be adaptable into a general purpose readable console encoder for Zap -- either in the official package or as an external library. |
This is related to #1076