Maksim Kasimov wrote:
[Example snipped]
Will the following do what you want?
Don't add handlers in each module. Just add a handler to the root
logger in the main script. Thus:
module1.py:
import logging
logger = logging.getLogger('module1')
#now use the logger in your code
module2.py:
import l
hello
in my modules, I'm using logging module, doing thus (there is a few modules):
in module1.py:
hdl = logging.StreamHandler()
fmt = logging.Formatter("%(name)s:\t%(levelname)s:\t%(asctime)s:\t%(message)s")
hdl.setFormatter(fmt)
log = logging.getLogger('module1')
log.addHandler(hdl)
In scr