Commit 8ef40598 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

Timestamp for logs

parent 861f0f18
......@@ -3,6 +3,7 @@
# Standard imports
from logging.handlers import RotatingFileHandler
import logging
import datetime as dt
# Custom imports
from cadbiom import info
......@@ -35,8 +36,9 @@ formatter = logging.Formatter(
'%(asctime)s :: %(levelname)s :: %(message)s'
)
file_handler = RotatingFileHandler(
DIR_LOGS + LOGGER_NAME + '.log',
'a', 1000000, 1
DIR_LOGS + LOGGER_NAME + dt.datetime.now().strftime("%Y-%m-%d_%H:%M:%S") + \
'.log',
'a', 100000000, 1
)
file_handler.setLevel(LOG_LEVEL)
file_handler.setFormatter(formatter)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment