From: Thomas Grainger Date: Thu, 31 Mar 2022 09:25:39 +0000 (+0100) Subject: remove _setup_logging X-Git-Tag: v6.2.0b1~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3130%2Fhead;p=thirdparty%2Ftornado.git remove _setup_logging --- diff --git a/tornado/ioloop.py b/tornado/ioloop.py index 1a8f3c8ed..47b4804ad 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -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. diff --git a/tornado/platform/asyncio.py b/tornado/platform/asyncio.py index f80c42dc2..58d31ddd8 100644 --- a/tornado/platform/asyncio.py +++ b/tornado/platform/asyncio.py @@ -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: