Skip to content

Commit

Permalink
Fix import logging.handlers
Browse files Browse the repository at this point in the history
Change-Id: I2a84a2285d0409cf32c4a668374945934dc012e5
  • Loading branch information
nbourdau committed Mar 21, 2021
1 parent 1d90968 commit 8b5f043
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import logging
import os
from logging.handlers import TimedRotatingFileHandler


LOGGER = None
Expand All @@ -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")
Expand Down

0 comments on commit 8b5f043

Please sign in to comment.