Skip to content

Commit ff0d65b

Browse files
committed
fix: correct post_call typevar in annotate_logs overload + docstring typos
- In the 'Instance False, Requested True, Provided True' overload of annotate_logs, post_call used PostCall[S2, P2] while all 21 other overloads and the implementation signature use PostCall[S2, P3]. This was inconsistent with the rest of the type signature and broke type hinting for that specific overload. - Fix two docstring typos in plugins.py: 'excaption' -> 'exception' and 'fixs' -> 'fixes' in BasePlugin.uncaught_exception and RenamerPlugin/NameAdjusterPlugin __init__ docstrings.
1 parent 77ef2ee commit ff0d65b

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

annotated_logger/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ def annotate_logs(
644644
*,
645645
success_info: bool = True, # pragma: no mutate
646646
pre_call: PreCall[S2, P2] = None,
647-
post_call: PostCall[S2, P2] = None,
647+
post_call: PostCall[S2, P3] = None,
648648
_typing_self: Literal[False],
649649
_typing_requested: Literal[True],
650650
provided: Literal[True],

annotated_logger/plugins.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def filter(self, _record: logging.LogRecord) -> bool:
2424
def uncaught_exception(
2525
self, exception: Exception, logger: AnnotatedAdapter
2626
) -> AnnotatedAdapter:
27-
"""Handle an uncaught excaption."""
27+
"""Handle an uncaught exception."""
2828
if "success" not in logger.filter.annotations:
2929
logger.annotate(success=False)
3030
if "exception_title" not in logger.filter.annotations:
@@ -68,7 +68,7 @@ class FieldNotPresentError(Exception):
6868
"""Exception for a field that is supposed to be renamed, but is not present."""
6969

7070
def __init__(self, *, strict: bool = False, **kwargs: str) -> None:
71-
"""Store the list of names to rename and pre/post fixs."""
71+
"""Store the list of names to rename and pre/post fixes."""
7272
self.targets = kwargs
7373
self.strict = strict
7474

@@ -104,7 +104,7 @@ class NameAdjusterPlugin(BasePlugin):
104104
"""Plugin that prevents name collisions with splunk field names."""
105105

106106
def __init__(self, names: list[str], prefix: str = "", postfix: str = "") -> None:
107-
"""Store the list of names to rename and pre/post fixs."""
107+
"""Store the list of names to rename and pre/post fixes."""
108108
self.names = names
109109
self.prefix = prefix
110110
self.postfix = postfix

0 commit comments

Comments
 (0)