Landsat578 icon indicating copy to clipboard operation
Landsat578 copied to clipboard

Consider implementing logging module and allowing user to specify logging level

Open cgmorton opened this issue 6 years ago • 0 comments

I think the tool could benefit from fully implementing the logging module (https://docs.python.org/3/library/logging.html). I really like having the ability to control the amount of text that is returned to the console, especially for quickly identifying major problems and for debugging.

This could be done a number of ways, but at the minimum I would add a simple "debug" command line argument to turn on debug level logging (similar to how the gdal utilities work). I also like how the conda tools (install, update, etc.) have a "verbose" flag also (https://conda.io/docs/commands/conda-install.html) for quickly changing the level.

Within the code, you just have to determine what level each print statement is. For example, within image_download() the prints for "Authentication failed" and "CSRF_Token not found" should probably be at the error or critical level message, and I think the actual download URL should be returned at the debug level. In unzip_image(), the two print statements would probably be at the info level.

This is something I would be happy to make a branch for and start if you think it would help.

cgmorton avatar Oct 24 '17 18:10 cgmorton