Skip to content

Commit a21b2ce

Browse files
vladakVladimir Kotal
authored andcommitted
fix date format regression introduced with logging handler
1 parent 9bcd338 commit a21b2ce

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/sync/mirror.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,14 @@
214214
logging.root.removeHandler(handler)
215215

216216
logging.basicConfig(filename=logfile, filemode='a',
217-
format='%(asctime)s - %(levelname)s: %(message)s',
218-
datefmt='%m/%d/%Y %I:%M:%S %p',
219217
level=logging.DEBUG if args.debug
220218
else logging.INFO)
221219
logger = logging.getLogger(os.path.basename(sys.argv[0]))
222220
handler = RotatingFileHandler(logfile, maxBytes=0,
223221
backupCount=args.backupcount)
222+
formatter = logging.Formatter("%(asctime)s - %(levelname)s: "
223+
"%(message)s", '%m/%d/%Y %I:%M:%S %p')
224+
handler.setFormatter(formatter)
224225
handler.doRollover()
225226
#
226227
# Technically, adding a handler to the logger is not necessary

0 commit comments

Comments
 (0)