Hello all,
I want that each module has its own logger. I've defined the following
config file:
[formatters]
keys=f01
[handlers]
keys=console
[loggers]
keys=root,l01
[formatter_f01]
format=%(name)s : %(message)s
[handler_console]
class=StreamHan dler
args=[]
formatter=f01
[logger_root]
level=CRITICAL
handlers=consol e
[logger_l01]
level=DEBUG
qualname=l01
handlers=consol e
I use it like this:
import logging
import logging.config
logging.config. fileConfig('a.c onf')
log = logging.getLogg er('l01')
log.debug('zzz' )
I want logger_root to go to /dev/null, so I've configured it with level
CRITICAL. My understanding is that in this way debug messages are not
printed on logger_root's handler. However, running the program results
in the message being printed twice. What is the problem?
Thanks in advance,
Baurzhan.
I want that each module has its own logger. I've defined the following
config file:
[formatters]
keys=f01
[handlers]
keys=console
[loggers]
keys=root,l01
[formatter_f01]
format=%(name)s : %(message)s
[handler_console]
class=StreamHan dler
args=[]
formatter=f01
[logger_root]
level=CRITICAL
handlers=consol e
[logger_l01]
level=DEBUG
qualname=l01
handlers=consol e
I use it like this:
import logging
import logging.config
logging.config. fileConfig('a.c onf')
log = logging.getLogg er('l01')
log.debug('zzz' )
I want logger_root to go to /dev/null, so I've configured it with level
CRITICAL. My understanding is that in this way debug messages are not
printed on logger_root's handler. However, running the program results
in the message being printed twice. What is the problem?
Thanks in advance,
Baurzhan.
Comment