-
Notifications
You must be signed in to change notification settings - Fork 65
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
replace log with logrus #52
Conversation
I think zap would be a better/faster alternative |
While zap is definitely faster, this only has a few calls and the performance difference is negligible. Logrus is in maintenance mode, but is stable and shouldn't need any updates. In this case, I think it makes for a simpler swap, but I opened #55 to show what it would look like with zap. |
Here's some example output (all to stderr):
|
With the pretty print funcs, the output looks like this:
|
@@ -28,6 +29,9 @@ func (e *Executor) newGciCommand(use, short, long string, aliases []string, stdI | |||
if err != nil { | |||
return err | |||
} | |||
if *debug { |
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.
Here we can support more levels more than debug.
Looks good overall, |
9e1653d
to
4d897de
Compare
Signed-off-by: Greg Lightfoot <glightfoot3@gmail.com>
Signed-off-by: Greg Lightfoot <glightfoot3@gmail.com>
Signed-off-by: Greg Lightfoot <glightfoot3@gmail.com>
@glightfoot thanks for your contribution! |
Hello, the problems with logrus are:
In 99% of cases when you create a library, the It's better to create an abstraction around the logger with an interface and set up the logger in the |
This reverts commit b301814.
This replaces the std lib log with logrus to enable structured logging and levels. I attempted to guess what levels things should live at, as well as moved some things to structured fields, and changed the default output to stderr.
I can't get the tests to run correctly on my machine as they hang forever, but it seems to work.
Fixes #46