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
Option to disable/rename verbosity field #14
Conversation
zerologr.go
Outdated
@@ -33,10 +32,11 @@ var ( | |||
NameFieldName = "logger" | |||
// NameSeparator separates names for logr.WithName | |||
NameSeparator = "/" | |||
// VerbosityFieldName is the field key for logr.Info verbosity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document that "" means not to emit that value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thockin Fixed
435abc0
to
cc7a7b4
Compare
Looks good to me Just wondering if you are ok with having duplicate/conflicting verbosity/leveling in the output without an option to turn it off? ie: |
@tonglil Both zerolog.LevelFieldName and new zerologr.VerbosityFieldName are configurable. They may be redundant but always consistent on verbosity. zerolgor does not change zerolog global variable anymore. |
Thanks, forgot about |
Any way to merge this please? Happy to help be a contributor. |
Is anyone able to take a look here? Thanks! |
@@ -16,8 +16,7 @@ | |||
// Levels in logr correspond to custom debug levels in Zerolog. Any given level | |||
// in logr is represents by `zerologLevel = 1 - logrLevel`. | |||
// For example V(2) is equivalent to Zerolog's TraceLevel, while V(1) is | |||
// equivalent to Zerolog's DebugLevel. Zerolog's usual "level" field is | |||
// disabled globally and replaced with "v", whose value is a number and is only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of "Zerolog's usual "level" field is disabled globally" implies that it is no longer disabled. But I don't see such a change in this PR. Was that already done earlier, without updating this doc comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like #7 did that, so this doc update is just a follow-up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I'll give Tim a bit more time as he had been reviewing it before and then will merge it.
Thanks for the merge @pohly, any chance a release could be made? |
@tonglil released |
Simpler alternative for #13