You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since zap-logfmt registers itself as an encoder with zap, (arguably), it's even simpler to use than the current example in the README suggests, i.e. e.g.:
That means it's 5 lines shorter, doesn't require knowledge of zap's core API and doesn't change other zap defaults (i.e. logging to stdout instead of stderr and changing the logging severity to debug - although debug isn't used in the example).
It produces the same output as the current first example:
ts=1598901552.010505 level=info msg="Hello World"
Thus, perhaps you want include something like the above in your README.
Perhaps you also want to extend the README a bit:
Explicitly mention that this package registers itself with the "logfmt" key such that Config.Encoding can be used to switch to logfmt output. FWIW - as being new to zap and your package - this wasn't obvious to me.
Add some example output for the examples.
The text was updated successfully, but these errors were encountered:
Since zap-logfmt registers itself as an encoder with zap, (arguably), it's even simpler to use than the current example in the README suggests, i.e. e.g.:
That means it's 5 lines shorter, doesn't require knowledge of zap's core API and doesn't change other zap defaults (i.e. logging to stdout instead of stderr and changing the logging severity to debug - although debug isn't used in the example).
It produces the same output as the current first example:
Thus, perhaps you want include something like the above in your README.
Perhaps you also want to extend the README a bit:
"logfmt"
key such thatConfig.Encoding
can be used to switch to logfmt output. FWIW - as being new to zap and your package - this wasn't obvious to me.The text was updated successfully, but these errors were encountered: