From f72d33f9648df064e6526348011f15e5425bfbde Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Fri, 22 Apr 2022 10:37:47 -0400 Subject: [PATCH] autoreload: Remove calls to logging.basicConfig This is unnecessary since python 3.2 added a default logger of last resort (and the two calls that precede "info" log messages didn't do anything in the first place since basicConfig only logs warnings and higher). Fixes the second part of #2961 --- tornado/autoreload.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tornado/autoreload.py b/tornado/autoreload.py index db47262be..0ac449665 100644 --- a/tornado/autoreload.py +++ b/tornado/autoreload.py @@ -76,7 +76,6 @@ if __name__ == "__main__": del sys.path[0] import functools -import logging import os import pkgutil # type: ignore import sys @@ -325,10 +324,8 @@ def main() -> None: del __package__ exec_in(f.read(), globals(), globals()) except SystemExit as e: - logging.basicConfig() gen_log.info("Script exited with status %s", e.code) except Exception as e: - logging.basicConfig() gen_log.warning("Script exited with uncaught exception", exc_info=True) # If an exception occurred at import time, the file with the error # never made it into sys.modules and so we won't know to watch it. @@ -343,7 +340,6 @@ def main() -> None: if e.filename is not None: watch(e.filename) else: - logging.basicConfig() gen_log.info("Script exited normally") # restore sys.argv so subsequent executions will include autoreload sys.argv = original_argv -- 2.47.2