Skip to content

Commit 00e20bb

Browse files
committed
log a debug message about reconfiguring logging in batch mode
1 parent d8cb5a7 commit 00e20bb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/sync/mirror.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,16 @@
176176

177177
# Log messages to dedicated log file if running in batch mode.
178178
if args.batch:
179+
logfile = os.path.join(logdir, args.project + ".log")
180+
logger.debug("Switching logging to the {} file".
181+
format(logfile))
179182
logging.shutdown()
180183

181184
# Remove the existing handler so that logger can be reconfigured.
182185
for handler in logging.root.handlers[:]:
183186
logging.root.removeHandler(handler)
184187

185-
logging.basicConfig(filename=os.path.join(logdir,
186-
args.project + ".log"), filemode='a',
188+
logging.basicConfig(filename=logfile, filemode='a',
187189
format='%(asctime)s - %(levelname)s: %(message)s',
188190
datefmt='%m/%d/%Y %I:%M:%S %p',
189191
level=logging.DEBUG if args.debug

0 commit comments

Comments
 (0)