Commit 51ca4e46 authored by ysard's avatar ysard
Browse files

Fix logs => move them to system temp dir

parent ff0755ad
include cadbiom/logs/force_inclusion
......@@ -30,16 +30,13 @@
from logging.handlers import RotatingFileHandler
import logging
import datetime as dt
import pkg_resources
import tempfile
# Custom imports
from cadbiom import info
# Paths
DIR_LOGS = pkg_resources.resource_filename(
__name__,
"logs/"
)
DIR_LOGS = tempfile.gettempdir() + '/'
# Logging
LOGGER_NAME = info.PACKAGE_NAME
......@@ -65,8 +62,8 @@ formatter = logging.Formatter(
'%(asctime)s :: %(levelname)s :: %(message)s'
)
file_handler = RotatingFileHandler(
DIR_LOGS + LOGGER_NAME + dt.datetime.now().strftime("%Y-%m-%d_%H:%M:%S") + \
'.log',
DIR_LOGS + LOGGER_NAME + '_' + \
dt.datetime.now().strftime("%Y-%m-%d_%H:%M:%S") + '.log',
'a', 100000000, 1
)
file_handler.setLevel(LOG_LEVELS[LOG_LEVEL])
......
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