Open opsdep opened 3 years ago
You need to choose one way to configure logging:
- either use the current mechanism with logger attributes defined for each object using
nansat.utils.add_logger
- or use a global logging configuration initialized in
nansat.__init__
No we need both of them because the run can be started with nansat usage as standalone (in that case, we need
nansat.__init__
), and as the second case when we run the harvesting, thenansat.utils.add_logger
function configures the logger when it is needed.
It works exactly the same whether you use nansat alone or with geospaas_harvesting: the "Nansat" logger is created when nansat
is imported, then the log level is overridden when add_logger
is called (for example when a Nansat object is instantiated).
If you are going to use add_logger
, you might as well put the whole logging configuration in there. It will be less confusing than having the configuration in logging.yml and then overriding the log level when add_logger
is called.
@aperrin66 done
No we need both of them because the run can be started with nansat usage as standalone (in that case, we need
nansat.__init__
), and as the second case when we run the harvesting, thenansat.utils.add_logger
function configures the logger when it is needed.