modifié: m/log.py
modifié: superTornado.py
This commit is contained in:
9
m/log.py
9
m/log.py
@ -8,6 +8,7 @@ class Log(object):
|
||||
def __init__(self) :
|
||||
|
||||
logging.addLevelName(25, "SUCCESS")
|
||||
logging.addLevelName(45, "ILLEGALUSER")
|
||||
|
||||
self.logger = logging.getLogger()
|
||||
self.logger.setLevel(logging.DEBUG)
|
||||
@ -23,6 +24,12 @@ class Log(object):
|
||||
file_handler_error.setFormatter(formatter)
|
||||
self.logger.addHandler(file_handler_error)
|
||||
|
||||
file_handler = RotatingFileHandler('illegal.log', 'a', 1000000, 1)
|
||||
file_handler.setLevel(logging.ILLEGALUSER)
|
||||
file_handler.setFormatter(formatter)
|
||||
self.logger.addHandler(file_handler)
|
||||
|
||||
|
||||
steam_handler = logging.StreamHandler()
|
||||
steam_handler.setLevel(logging.NOTSET)
|
||||
self.logger.addHandler(steam_handler)
|
||||
@ -37,7 +44,7 @@ class Log(object):
|
||||
pMsg = bcolors.SUCCESS + pMsg + bcolors.ENDC
|
||||
elif pLvl == 30 :
|
||||
pMsg = bcolors.WARNING + pMsg + bcolors.ENDC
|
||||
elif pLvl == 40 :
|
||||
elif pLvl == 40 or pLvl ==45 :
|
||||
pMsg = bcolors.FAIL + pMsg + bcolors.ENDC
|
||||
self.logger.log(pLvl,pMsg)
|
||||
|
||||
|
Reference in New Issue
Block a user