utils: change notify level to info

This commit is contained in:
JerryXiao 2019-09-06 12:10:47 +08:00
parent 7f807b3197
commit 82cf5c7c14
Signed by: Jerry
GPG key ID: 9D9CE43650FF2BAA

View file

@ -285,11 +285,8 @@ def configure_logger(logger, format='%(asctime)s - %(name)-18s - %(levelname)s -
return fmtr
logger.setLevel(logging.DEBUG)
fnotify = cnotify = False
fnotify = True if enable_notify and logfile else False
cnotify = True if enable_notify and (not logfile) else False
fformatter = ExceptionFormatter(fmt=format, notify=fnotify)
cformatter = ExceptionFormatter(fmt=format, notify=cnotify)
fformatter = ExceptionFormatter(fmt=format, notify=False)
cformatter = ExceptionFormatter(fmt=format, notify=True)
logging.addLevelName(49, 'Exception')
# create file handler
if logfile:
@ -311,7 +308,6 @@ def configure_logger(logger, format='%(asctime)s - %(name)-18s - %(levelname)s -
assert type(consolelog) is str
cfh = logging.FileHandler(consolelog)
cfh.setLevel(level)
cfhformatter = ExceptionFormatter(fmt=format, notify=False)
cfh.setFormatter(cfhformatter)
cfh.setFormatter(cformatter)
logger.addHandler(cfh)
# for client.printlog