-
Notifications
You must be signed in to change notification settings - Fork 1
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
Use a single, non-replaceable default logger #24
Conversation
f00c8f1
to
18e1654
Compare
We'll want to bump a new version of the package when this changes land. But before that, we also want to rename |
I will make the change to |
34323bc
to
72b5b6a
Compare
Also added one more commit that includes an example service you can run to prove that logger reconfiguration works: 72b5b6a. |
@marcosnav @eduardocfalcao Are you ok with merging this one now? |
72b5b6a
to
7ec7f8c
Compare
@jonyoder Yes, I'm okay with it :) |
Connected to #22. This PR:
SetDefaultLogger
method. Instead of replacing the default logger with a new reference, simply use theSet*
methods to update the existing default logger as needed.SetFormatter
andTracef
to the logger interface.Tracef
to the debug logger interface.DefaultLoggerFactory
that can be set in aninit()
method to provide therslog
package with a different default logger. If this is unset,rslog
will automatically create its own factory and default logger. Seeroot.go
in the example command directory for an example.Copy
method. We no longer support copying a logger since it makes SIGHUP support impossible.SetReportCaller
method. Since logrus reports the first non-logrus line of code, this feature was useless since it always simply reported a line of code in therslog
package.defaultLogger
rather than copying an existing logger.debug
command and a new global--level
flag.Compare(l LogLevel)
method to theLogLevel
struct so you can compare log levels based on the underlying logrus values.Using the example commands: