From 60c072dc465781890ea5cf019b392580d1a078da Mon Sep 17 00:00:00 2001 From: sidya82 Date: Mon, 3 Mar 2014 19:19:42 +0100 Subject: [PATCH] =?UTF-8?q?=09modifi=C3=A9:=20=20=20=20=20=20=20=20=20m/lo?= =?UTF-8?q?g.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- m/log.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/m/log.py b/m/log.py index 3402311..d6661ce 100644 --- a/m/log.py +++ b/m/log.py @@ -13,7 +13,8 @@ class lvl: NOTSET = 0 DEBUG = 10 INFO = 20 - SUCCESS = 25 + SUCCESS = 21 + ILLEGAL = 25 WARNING = 30 FAIL = 40 @@ -32,6 +33,7 @@ class Log(object): def __init__(self) : logging.addLevelName(lvl.SUCCESS, "SUCCESS") + logging.addLevelName(lvl.ILLEGAL, "ILLEGAL") self.logger = logging.getLogger() self.logger.setLevel(logging.DEBUG) @@ -42,8 +44,8 @@ class Log(object): file_handler.setFormatter(formatter) self.logger.addHandler(file_handler) - file_handler_warning = RotatingFileHandler('warning.log', 'a', 1000000, 1) - f1 = SingleLevelFilter(logging.WARNING, False) + file_handler_warning = RotatingFileHandler('illegal.log', 'a', 1000000, 1) + f1 = SingleLevelFilter(logging.ILLEGAL, False) file_handler_warning.addFilter(f1) file_handler.setFormatter(formatter) self.logger.addHandler(file_handler_warning)