1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2024-12-22 07:43:09 +00:00

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

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)