Add '.log' suffix to log files. By @bigtedde (#1710)

This commit is contained in:
Ted Lawson 2023-09-25 14:51:17 -07:00 committed by GitHub
parent 43140beda1
commit cff00ad8e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -24,6 +24,8 @@ def init_logger(background=False):
# create handlers
fh = TimedRotatingFileHandler(config.LOG_DIR / 'vorta.log', when='d', interval=1, backupCount=5)
# ensure ".log" suffix
fh.namer = lambda log_name: log_name.replace(".log", "") + ".log"
fh.setLevel(logging.DEBUG)
fh.setFormatter(formatter)
logger.addHandler(fh)