Open VincentVerelst opened 1 month ago
I might be missing some context, but some quick feedback
global pipeline_log
It shouldn't be necessary to use globals here.
logging.getLogger("pipeline_sar")
will return the same object even if called from different places, so no need to pass things around with globals.
That ManagerLoggerFilter
pattern looks a bit dangerous because it will suppress everything (warnings and errors) from other components, which might hide actual problems.
I think something like the following has the same intent, but will not hide warnings/errors:
import logging
logging.basicConfig(level=logging.INFO) # you can also specify a custom format here
# Set default log level to warning ...
logging.getLogger().setLevel(logging.WARNING)
# ... but use INFO level for our own logs
logging.getLogger("pipeline_sar").setLevel(logging.INFO)
Currently, a user has to manually set up a logger function. For example:
We could provide a basic setup_logger function like this in GFMap, such that the user only needs to specify the loglevel.