From 8b5f043c9b423e0d6de7ee52075bd0b800ce4ccc Mon Sep 17 00:00:00 2001 From: Nicolas Bourdaud Date: Sun, 21 Mar 2021 23:33:30 +0100 Subject: [PATCH] Fix import logging.handlers Change-Id: I2a84a2285d0409cf32c4a668374945934dc012e5 --- src/common.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/common.py b/src/common.py index cde06e1..afffbe5 100644 --- a/src/common.py +++ b/src/common.py @@ -8,6 +8,7 @@ import logging import os +from logging.handlers import TimedRotatingFileHandler LOGGER = None @@ -27,9 +28,7 @@ def init_logger(log_file): global LOGGER # pylint: disable=global-statement os.makedirs(os.path.dirname(log_file), exist_ok=True) - log_handler = logging.handlers.TimedRotatingFileHandler(log_file, - when='D', - backupCount=30) + log_handler = TimedRotatingFileHandler(log_file, when='D', backupCount=30) formatter = logging.Formatter("%(asctime)s: %(levelname)s: %(message)s", "%Y-%m-%d %H:%M:%S")