I'm trying to establish logging in all modules I'm using. My project structure is
# driver.py import logging logger = logging.getLogger(__name__) class driver: .... # driver_wrapper.py from driver import driver device = driver(...) def driver_func(): logging.info("...") .... # main.py import logging import driver_wrapper logging.basicConfig(stream=sys.stdout, level=logging.WARNING) driver_wrapper.driver_func() My problem now is that I still get INFO level messages and also the output is 'INFO:root'. But I would expect the module name instead of root.
Is there a way to set the logging level in the main.py for all modules or is it already correct how I do it? There are a lot of posts about this problem but the solutions don't seem to work for me.