Capture Python warnings in the sources.log

Otherwise the warnings will be printed to the console instead.

Solution-from: Stuart Prescott <themill> on #debian-apt
parent ee6efc04
......@@ -136,6 +136,7 @@ del session.headers['Accept-Encoding']
log_file = sys.argv[7]
remove(sys.argv[7])
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG, filename=log_file)
logging.captureWarnings(True)
# Don't do anything on hosts without the snapshot.d.o farm
if not os.path.isdir(snapshot_cache_dir):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment