Final for logging constants (#12453)

This commit is contained in:
Max Muoto
2024-07-28 04:58:30 -05:00
committed by GitHub
parent 3db7f01a31
commit 8ac4af63cd
2 changed files with 18 additions and 18 deletions

View File

@@ -7,7 +7,7 @@ from re import Pattern
from string import Template
from time import struct_time
from types import FrameType, TracebackType
from typing import Any, ClassVar, Generic, Literal, Protocol, TextIO, TypeVar, overload
from typing import Any, ClassVar, Final, Generic, Literal, Protocol, TextIO, TypeVar, overload
from typing_extensions import Self, TypeAlias, deprecated
if sys.version_info >= (3, 11):
@@ -236,14 +236,14 @@ class Logger(Filterer):
def hasHandlers(self) -> bool: ...
def callHandlers(self, record: LogRecord) -> None: ... # undocumented
CRITICAL: int
FATAL: int
ERROR: int
WARNING: int
WARN: int
INFO: int
DEBUG: int
NOTSET: int
CRITICAL: Final = 50
FATAL: Final = CRITICAL
ERROR: Final = 40
WARNING: Final = 30
WARN: Final = WARNING
INFO: Final = 20
DEBUG: Final = 10
NOTSET: Final = 0
class Handler(Filterer):
level: int # undocumented
@@ -684,6 +684,6 @@ class StrFormatStyle(PercentStyle): # undocumented
class StringTemplateStyle(PercentStyle): # undocumented
_tpl: Template
_STYLES: dict[str, tuple[PercentStyle, str]]
_STYLES: Final[dict[str, tuple[PercentStyle, str]]]
BASIC_FORMAT: str
BASIC_FORMAT: Final[str]

View File

@@ -8,16 +8,16 @@ from logging import FileHandler, Handler, LogRecord
from re import Pattern
from socket import SocketKind, socket
from threading import Thread
from typing import Any, ClassVar, Protocol, TypeVar
from typing import Any, ClassVar, Final, Protocol, TypeVar
_T = TypeVar("_T")
DEFAULT_TCP_LOGGING_PORT: int
DEFAULT_UDP_LOGGING_PORT: int
DEFAULT_HTTP_LOGGING_PORT: int
DEFAULT_SOAP_LOGGING_PORT: int
SYSLOG_UDP_PORT: int
SYSLOG_TCP_PORT: int
DEFAULT_TCP_LOGGING_PORT: Final[int]
DEFAULT_UDP_LOGGING_PORT: Final[int]
DEFAULT_HTTP_LOGGING_PORT: Final[int]
DEFAULT_SOAP_LOGGING_PORT: Final[int]
SYSLOG_UDP_PORT: Final[int]
SYSLOG_TCP_PORT: Final[int]
class WatchedFileHandler(FileHandler):
dev: int # undocumented