gruntwork-io / fetch

Download files, folders, and release assets from a specific git commit, branch, or tag of public and private GitHub repos.
https://www.gruntwork.io/
MIT License
587 stars 90 forks source link

Add a proper logger to fetch #90

Closed robmorgan closed 3 years ago

robmorgan commented 3 years ago

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

Progress

robmorgan commented 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?

robmorgan commented 3 years ago

@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.