-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add NoUppercaseLevel option #6
Conversation
formatter.go
Outdated
@@ -34,6 +34,9 @@ type Formatter struct { | |||
// ShowFullLevel - show a full level [WARNING] instead of [WARN] | |||
ShowFullLevel bool | |||
|
|||
// NoUpcaseLevel - no upper case for level value | |||
NoUpcaseLevel bool |
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.
Hey @dfateyev! Thanks for the PR, I like it! Let's make it NoUppercaseLevel
?
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.
Let's make it
NoUppercaseLevel
?
Well, the only concern is it would be bulky being compared to other options (16 chars against the longest 14 chars NoFieldsColors
parameter). But if you think it's better — I can adjust the name.
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.
Yes, it's longer, but it feels grammatically correct 👍
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.
I have merged all changes into one commit, and renamed PR according the new option's name. Please review the current changes.
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.
NoColors bool
// NoFieldsColors - apply colors only to the level, default is level + fields
NoFieldsColors bool
// NoFieldsSpace - no space between fields
NoFieldsSpace bool
// ShowFullLevel - show a full level [WARNING] instead of [WARN]
ShowFullLevel bool
// NoUppercaseLevel - no upper case for level value
NoUppercaseLevel bool
// TrimMessages - trim whitespaces on messages
TrimMessages bool
Btw, "NoUppercaseLevel" is placed after "ShowFullLevel" in Readme. In case if it matters — I can move it after "NoFieldsSpace" (to me, there is no much difference though).
@dfateyev thanks! |
A small but usable log level formatting option, for those who don't want to see it upper case.
Being set to "true", it doesn't transform the original level value.