-
Notifications
You must be signed in to change notification settings - Fork 78
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
funcr Feature Request: Add LogInfoLevel Option to skip logging level in the info log #239
Comments
Do you see an advantage in using funcr compared to some other backend (like zapr, which you already mentioned)? I'm not sure how much further changes will be done (or accepted) there. Note that as of 1.3.0, you can also use slog backends, so if you are on Go 1.21 and worried about additional dependencies, then you can configure the log/slog JSON handler as backend for logr. |
I don't think one is too bad for funcr, and I would probably accept it as a PR. Something @pohly said without saying - funcr doesn't currently support slog, whereas |
In fact, I only use the If I use zapr or slog, there will be two headers for each log: one from Envoy, the other from Go logger. Therefore I choose to build a logger from scratch. |
Great! I will give it a try when I have free time. |
There are similar building blocks for slog - see https://github.com/golang/go/wiki/Resources-for-slog. But enhancing funcr might be simpler. |
@pohly |
Currently, the info level is always logged:
logr/funcr/funcr.go
Line 743 in 41d36ee
However, in some situations, people may not use the log level or have an alternative to the integer log level field. So logging the integer log level in these situations may be a little useless.
The zapr implementation has an option called
LogInfoLevel
to control if the numeric log level is logged:https://github.com/go-logr/zapr/blob/78b8af5329abd1ba8695aad821f95fb2e7f4e651/zapr.go#L270
What about adding a similar feature to logr? I am glad to implement it if it is accepted.
The text was updated successfully, but these errors were encountered: