Poulet
This commit is contained in:
parent
9030013c68
commit
9216f5ed45
@ -4,9 +4,11 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
from logging.handlers import RotatingFileHandler
|
from logging.handlers import RotatingFileHandler
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class bcolors:
|
class bcolors:
|
||||||
"""
|
"""
|
||||||
Define constant color value for different level
|
Define constant color value for different level
|
||||||
@ -62,6 +64,8 @@ class Log(object):
|
|||||||
error.log -> error
|
error.log -> error
|
||||||
Write all message on terminal too
|
Write all message on terminal too
|
||||||
"""
|
"""
|
||||||
|
if not os.path.exists("log"):
|
||||||
|
os.makedirs("log")
|
||||||
self.logger = logging.getLogger()
|
self.logger = logging.getLogger()
|
||||||
self.logger.setLevel(logging.DEBUG)
|
self.logger.setLevel(logging.DEBUG)
|
||||||
formatter = logging.Formatter('%(asctime)-15s :: %(levelname)s :: %(message)s')
|
formatter = logging.Formatter('%(asctime)-15s :: %(levelname)s :: %(message)s')
|
||||||
|
Reference in New Issue
Block a user