From eaf8b4d7a52374712d71afd5049a13f70267130a Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Mon, 27 Jun 2022 13:41:32 +0200 Subject: [PATCH] Revert `logging` file name modification (#1543) --- setup.cfg | 2 +- tests/middleware/test_message_logger.py | 2 +- uvicorn/config.py | 6 +++--- uvicorn/{_logging.py => logging.py} | 0 uvicorn/middleware/message_logger.py | 2 +- uvicorn/protocols/http/h11_impl.py | 2 +- uvicorn/protocols/http/httptools_impl.py | 2 +- uvicorn/protocols/websockets/websockets_impl.py | 2 +- uvicorn/protocols/websockets/wsproto_impl.py | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) rename uvicorn/{_logging.py => logging.py} (100%) diff --git a/setup.cfg b/setup.cfg index 2d1fef39b..0c789aa4f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,7 +24,7 @@ files = uvicorn/middleware/wsgi.py, uvicorn/supervisors/watchfilesreload.py, uvicorn/supervisors/watchgodreload.py, - uvicorn/_logging.py, + uvicorn/logging.py, uvicorn/middleware/asgi2.py, uvicorn/server.py, uvicorn/__init__.py, diff --git a/tests/middleware/test_message_logger.py b/tests/middleware/test_message_logger.py index 24781f814..11fc4810f 100644 --- a/tests/middleware/test_message_logger.py +++ b/tests/middleware/test_message_logger.py @@ -2,7 +2,7 @@ import pytest from tests.middleware.test_logging import caplog_for_logger -from uvicorn._logging import TRACE_LOG_LEVEL +from uvicorn.logging import TRACE_LOG_LEVEL from uvicorn.middleware.message_logger import MessageLoggerMiddleware diff --git a/uvicorn/config.py b/uvicorn/config.py index f50bc3bc2..9e6b02391 100644 --- a/uvicorn/config.py +++ b/uvicorn/config.py @@ -23,7 +23,7 @@ from h11._connection import DEFAULT_MAX_INCOMPLETE_EVENT_SIZE -from uvicorn._logging import TRACE_LOG_LEVEL +from uvicorn.logging import TRACE_LOG_LEVEL if sys.version_info < (3, 8): # pragma: py-gte-38 from typing_extensions import Literal @@ -97,12 +97,12 @@ "disable_existing_loggers": False, "formatters": { "default": { - "()": "uvicorn._logging.DefaultFormatter", + "()": "uvicorn.logging.DefaultFormatter", "fmt": "%(levelprefix)s %(message)s", "use_colors": None, }, "access": { - "()": "uvicorn._logging.AccessFormatter", + "()": "uvicorn.logging.AccessFormatter", "fmt": '%(levelprefix)s %(client_addr)s - "%(request_line)s" %(status_code)s', # noqa: E501 }, }, diff --git a/uvicorn/_logging.py b/uvicorn/logging.py similarity index 100% rename from uvicorn/_logging.py rename to uvicorn/logging.py diff --git a/uvicorn/middleware/message_logger.py b/uvicorn/middleware/message_logger.py index 4738e0752..e3d7a5721 100644 --- a/uvicorn/middleware/message_logger.py +++ b/uvicorn/middleware/message_logger.py @@ -11,7 +11,7 @@ WWWScope, ) -from uvicorn._logging import TRACE_LOG_LEVEL +from uvicorn.logging import TRACE_LOG_LEVEL PLACEHOLDER_FORMAT = { "body": "<{length} bytes>", diff --git a/uvicorn/protocols/http/h11_impl.py b/uvicorn/protocols/http/h11_impl.py index e9378c9f0..89e550229 100644 --- a/uvicorn/protocols/http/h11_impl.py +++ b/uvicorn/protocols/http/h11_impl.py @@ -7,8 +7,8 @@ import h11 -from uvicorn._logging import TRACE_LOG_LEVEL from uvicorn.config import Config +from uvicorn.logging import TRACE_LOG_LEVEL from uvicorn.protocols.http.flow_control import ( CLOSE_HEADER, HIGH_WATER_LIMIT, diff --git a/uvicorn/protocols/http/httptools_impl.py b/uvicorn/protocols/http/httptools_impl.py index b71f3b491..016055858 100644 --- a/uvicorn/protocols/http/httptools_impl.py +++ b/uvicorn/protocols/http/httptools_impl.py @@ -10,8 +10,8 @@ import httptools -from uvicorn._logging import TRACE_LOG_LEVEL from uvicorn.config import Config +from uvicorn.logging import TRACE_LOG_LEVEL from uvicorn.protocols.http.flow_control import ( CLOSE_HEADER, HIGH_WATER_LIMIT, diff --git a/uvicorn/protocols/websockets/websockets_impl.py b/uvicorn/protocols/websockets/websockets_impl.py index 9a07a5d05..0a9437693 100644 --- a/uvicorn/protocols/websockets/websockets_impl.py +++ b/uvicorn/protocols/websockets/websockets_impl.py @@ -6,7 +6,7 @@ import websockets from websockets.extensions.permessage_deflate import ServerPerMessageDeflateFactory -from uvicorn._logging import TRACE_LOG_LEVEL +from uvicorn.logging import TRACE_LOG_LEVEL from uvicorn.protocols.utils import get_local_addr, get_remote_addr, is_ssl diff --git a/uvicorn/protocols/websockets/wsproto_impl.py b/uvicorn/protocols/websockets/wsproto_impl.py index b1a33c73e..eb8d860b3 100644 --- a/uvicorn/protocols/websockets/wsproto_impl.py +++ b/uvicorn/protocols/websockets/wsproto_impl.py @@ -9,7 +9,7 @@ from wsproto.extensions import PerMessageDeflate from wsproto.utilities import RemoteProtocolError -from uvicorn._logging import TRACE_LOG_LEVEL +from uvicorn.logging import TRACE_LOG_LEVEL from uvicorn.protocols.utils import get_local_addr, get_remote_addr, is_ssl