-
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
Add NullLogger #26
Comments
Do you want to send a PR for this or do you want me to just copy it and attribute you? I am tempted to just leave it in the logr package. |
Also - expose type or |
After some thought I also came to the conclusion that it's better to put it at the logr package level, because the null logger needs to import the Logger interface, and then the main package would no longer be able to import the null logger due to a circular import. I will add a PR for this and then we can further discuss the details there. |
Following discussion in #25, it is probably a good idea to add a
null.Logger
to logr that ignores all messages.This can be used as a default logger by components that optionally allow you to pass in a logger. If none is passed in, it can simply use the null logger for all its logging.
The implementation would live under a "null" subpackage and could look like this (needs doc comments):
Usage:
The text was updated successfully, but these errors were encountered: