Skip to content

Commit

Permalink
Change to rollover from rotate.
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen committed Aug 25, 2021
1 parent b423844 commit f000e7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions homeassistant/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def async_enable_logging(
not err_path_exists and os.access(err_dir, os.W_OK)
):

err_handler: logging.FileHandler
err_handler: logging.handlers.RotatingFileHandler | logging.handlers.TimedRotatingFileHandler
if log_rotate_days:
err_handler = logging.handlers.TimedRotatingFileHandler(
err_log_path, when="midnight", backupCount=log_rotate_days
Expand All @@ -342,7 +342,7 @@ def async_enable_logging(
err_log_path, backupCount=1
)

err_handler.rotate(err_log_path, f"{err_log_path[:-4]}.previous.log")
err_handler.doRollover()
err_handler.setLevel(logging.INFO if verbose else logging.WARNING)
err_handler.setFormatter(logging.Formatter(fmt, datefmt=datefmt))

Expand Down

0 comments on commit f000e7e

Please sign in to comment.