fix boulette
This commit is contained in:
parent
2585d99183
commit
0d397e06a4
1 changed files with 3 additions and 3 deletions
|
@ -26,20 +26,20 @@ from sys import argv
|
||||||
here = os.path.dirname(os.path.abspath(__file__))
|
here = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
## création de l'objet logger
|
## création de l'objet logger
|
||||||
logger = logging.etLogger()
|
logger = logging.getLogger()
|
||||||
## definition du log level
|
## definition du log level
|
||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
## format du log
|
## format du log
|
||||||
formatter = logging.Formatter('%(asctime)s :: %(levelname)s :: %(message)s')
|
formatter = logging.Formatter('%(asctime)s :: %(levelname)s :: %(message)s')
|
||||||
|
|
||||||
# definition du fichier de log (chemin, level, etc ...)
|
## definition du fichier de log (chemin, level, etc ...)
|
||||||
file_handler = RotatingFileHandler('/var/log/kabot.log', 'a', 1000000, 1)
|
file_handler = RotatingFileHandler('/var/log/kabot.log', 'a', 1000000, 1)
|
||||||
file_handler.setLevel(logging.DEBUG)
|
file_handler.setLevel(logging.DEBUG)
|
||||||
file_handler.setFormatter(formatter)
|
file_handler.setFormatter(formatter)
|
||||||
logger.addHandler(file_handler)
|
logger.addHandler(file_handler)
|
||||||
|
|
||||||
# definition de l'affichage des logs dans la console
|
## definition de l'affichage des logs dans la console
|
||||||
stream_handler = logging.StreamHandler()
|
stream_handler = logging.StreamHandler()
|
||||||
stream_handler.setLevel(logging.DEBUG)
|
stream_handler.setLevel(logging.DEBUG)
|
||||||
logger.addHandler(stream_handler)
|
logger.addHandler(stream_handler)
|
||||||
|
|
Loading…
Reference in a new issue