-
Notifications
You must be signed in to change notification settings - Fork 92
Add a proper logger to fetch #90
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
Conversation
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.
Nice, thanks Rob!
We should probably add a --log-level
param so you can control the amount of logging.
Thanks! Yeah, I intentionally avoided that and instead defaulted to 'INFO'. I wasn't sure if it made sense because I would either suppress a lot of the existing messages by default or we'd need to sprinkle in a few debug messages around the place to actually make it useful. I thought it would be easier to leave it out to under complicate this PR, but I agree it's something we'd want in the future. I could add it but default it to 'INFO' then people can override it to 'ERROR' or 'DEBUG'. What do you think? |
@brikis98 okay I've added a |
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.
Very nice, thanks Rob! 👍
This PR introduces a proper logger to
fetch
to ensure it's output is in line with other Gruntwork tools. It also makes integration testing much easier and solves the following issues:Note: This PR must be merged after #88 as it improves upon it.
Design Notes
FetchOptions
struct, so I’m directly passing in a logger to follow the same pattern in most methods.logrus
library but only saw the macOS binary increase by 100kb from 8.9M to ~9.0M.Progress
fmt.Printf
calls.logrus
library.