[FIX] Workaround for the use of the log level notset

bzr revid: stephane@tinyerp.com-20081222231956-lqhpz6r1g568hbpu
This commit is contained in:
Stephane Wirtel 2008-12-23 00:19:56 +01:00
parent cfc56e0b38
commit 933641d50c
1 changed files with 1 additions and 4 deletions

View File

@ -192,7 +192,7 @@ def init_logger():
# add the handler to the root logger
logger.addHandler(handler)
logger.setLevel(config['log_level'])
logger.setLevel(config['log_level'] or '0')
if isinstance(handler, logging.StreamHandler) and os.name != 'nt':
# change color of level names
@ -229,9 +229,6 @@ class Logger(object):
def notifyChannel(self, name, level, msg):
log = logging.getLogger(name)
if level == LOG_NOTSET:
return
if level == LOG_DEBUG_RPC and not hasattr(log, level):
fct = lambda msg, *args, **kwargs: log.log(logging.DEBUG_RPC, msg, *args, **kwargs)
setattr(log, LOG_DEBUG_RPC, fct)