Skip to content

Idiomatically use logging

According to the Python's documentation the good convention is to allocate a module level logging for each file:

https://docs.python.org/3/howto/logging.html#logging-advanced-tutorial

Replace existing logging singletron with module level loggers.

Replace the f-string formatters with a deferred log formatters using the %. This will allow the string formatting only to happen when it is enabled.

The CLI main function will now setup the root logger with basicConfig which configures the StreamLogger to stderr. Previously the logging singletron would setup the logging which made it incompatible with using glcollate as library as library user should be given ability to configure logging.

Merge request reports

Loading