]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
remove _setup_logging 3130/head
authorThomas Grainger <tagrain@gmail.com>
Thu, 31 Mar 2022 09:25:39 +0000 (10:25 +0100)
committerThomas Grainger <tagrain@gmail.com>
Thu, 31 Mar 2022 09:35:52 +0000 (10:35 +0100)
tornado/ioloop.py
tornado/platform/asyncio.py

index 1a8f3c8ed835929c9c941dfacb5e8a03f7685283..47b4804ad29b6d7ad7efc7263abcdbe410fffc02 100644 (file)
@@ -34,7 +34,6 @@ import asyncio
 import concurrent.futures
 import datetime
 import functools
-import logging
 import numbers
 import os
 import sys
@@ -448,26 +447,6 @@ class IOLoop(Configurable):
         """
         raise NotImplementedError()
 
-    def _setup_logging(self) -> None:
-        """The IOLoop catches and logs exceptions, so it's
-        important that log output be visible.  However, python's
-        default behavior for non-root loggers (prior to python
-        3.2) is to print an unhelpful "no handlers could be
-        found" message rather than the actual log entry, so we
-        must explicitly configure logging if we've made it this
-        far without anything.
-
-        This method should be called from start() in subclasses.
-        """
-        if not any(
-            [
-                logging.getLogger().handlers,
-                logging.getLogger("tornado").handlers,
-                logging.getLogger("tornado.application").handlers,
-            ]
-        ):
-            logging.basicConfig()
-
     def stop(self) -> None:
         """Stop the I/O loop.
 
index f80c42dc26e4c74bfda0175541c081ba73175f81..58d31ddd8158e7cdcbb244ccc7cc48073ae03ca3 100644 (file)
@@ -212,7 +212,6 @@ class BaseAsyncIOLoop(IOLoop):
         except (RuntimeError, AssertionError):
             old_loop = None  # type: ignore
         try:
-            self._setup_logging()
             asyncio.set_event_loop(self.asyncio_loop)
             self.asyncio_loop.run_forever()
         finally: