Closed robmorgan closed 3 years ago
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 --log-level
option and ported the logging code over to gruntwork-cli
. To actually make the --log-level
option worthwhile I've sprinkled in a few DEBUG
log entries, so execute fetch
using --log-level debug
to see them.
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:30
89
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.