diff --git a/src/structlog/_output.py b/src/structlog/_output.py index 590114d5..68fa976b 100644 --- a/src/structlog/_output.py +++ b/src/structlog/_output.py @@ -271,6 +271,8 @@ class BytesLogger: __slots__ = ("_file", "_flush", "_lock", "_write", "name") + name: str | None + def __init__( self, file: BinaryIO | None = None, *, name: str | None = None ): diff --git a/src/structlog/processors.py b/src/structlog/processors.py index 05e28e78..20e6e1f2 100644 --- a/src/structlog/processors.py +++ b/src/structlog/processors.py @@ -147,6 +147,8 @@ class LogfmtRenderer: .. versionadded:: 21.5.0 """ + bool_as_flag: bool + def __init__( self, sort_keys: bool = False, @@ -404,6 +406,8 @@ class ExceptionRenderer: .. versionadded:: 22.1.0 """ + format_exception: ExceptionTransformer + def __init__( self, exception_formatter: ExceptionTransformer = _format_exception, @@ -478,6 +482,10 @@ class TimeStamper: __slots__ = ("_stamper", "fmt", "key", "utc") + fmt: str | None + utc: bool + key: str + def __init__( self, fmt: str | None = None, @@ -580,6 +588,8 @@ class MaybeTimeStamper: __slots__ = ("stamper",) + stamper: TimeStamper + def __init__( self, fmt: str | None = None, @@ -654,6 +664,8 @@ class ExceptionPrettyPrinter: Fixed *exception_formatter* so that it overrides the default if set. """ + format_exception: ExceptionTransformer + def __init__( self, file: TextIO | None = None, @@ -971,6 +983,9 @@ class EventRenamer: See also the :ref:`rename-event` recipe. """ + to: str + replace_by: str | None + def __init__(self, to: str, replace_by: str | None = None): self.to = to self.replace_by = replace_by diff --git a/src/structlog/stdlib.py b/src/structlog/stdlib.py index 6852d765..2906598d 100644 --- a/src/structlog/stdlib.py +++ b/src/structlog/stdlib.py @@ -784,6 +784,8 @@ class PositionalArgumentsFormatter: removed from the event dict after formatting a message. """ + remove_positional_args: bool + def __init__(self, remove_positional_args: bool = True) -> None: self.remove_positional_args = remove_positional_args @@ -1094,6 +1096,14 @@ class ProcessorFormatter(logging.Formatter): .. versionadded:: 23.3.0 *use_get_message* """ + processors: Sequence[Processor] + foreign_pre_chain: Sequence[Processor] | None + keep_exc_info: bool + keep_stack_info: bool + logger: logging.Logger | None + pass_foreign_args: bool + use_get_message: bool + def __init__( self, processor: Processor | None = None, @@ -1117,7 +1127,6 @@ def __init__( ) raise TypeError(msg) - self.processors: Sequence[Processor] if processor is not None: self.processors = (self.remove_processors_meta, processor) elif processors: diff --git a/src/structlog/tracebacks.py b/src/structlog/tracebacks.py index b9c9855a..5b01ad99 100644 --- a/src/structlog/tracebacks.py +++ b/src/structlog/tracebacks.py @@ -424,6 +424,15 @@ class ExceptionDictTransformer: Handle exception groups. """ + show_locals: bool + locals_max_length: int + locals_max_string: int + locals_hide_dunder: bool + locals_hide_sunder: bool + suppress: Sequence[str] + max_frames: int + use_rich: bool + def __init__( self, *, @@ -450,7 +459,7 @@ def __init__( self.locals_max_string = locals_max_string self.locals_hide_dunder = locals_hide_dunder self.locals_hide_sunder = locals_hide_sunder - self.suppress: Sequence[str] = [] + self.suppress = [] for suppress_entity in suppress: if not isinstance(suppress_entity, str): if suppress_entity.__file__ is None: diff --git a/src/structlog/twisted.py b/src/structlog/twisted.py index 15d0a262..fd817801 100644 --- a/src/structlog/twisted.py +++ b/src/structlog/twisted.py @@ -133,6 +133,8 @@ class ReprWrapper: Note the extra quotes in the unwrapped example. """ + string: str + def __init__(self, string: str) -> None: self.string = string