Skip to content

Commit

Permalink
🚧 [APPROVAL NEEDED] Explicitly specify class constructor parameters
Browse files Browse the repository at this point in the history
Resolves `TypeError`s thrown by Mypyc-compiled code as a result of
empty tuple assignment to an int-typed `level` parameter during
superclass initialization.
  • Loading branch information
TeoZosa committed Sep 12, 2021
1 parent e019a56 commit 070b940
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions structlog_sentry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,16 @@ class SentryJsonProcessor(SentryProcessor):
Uses Sentry SDK to capture events in Sentry.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
def __init__(
self,
level: int = logging.WARNING,
active: bool = True,
as_extra: bool = True,
tag_keys: Union[List[str], str] = None,
) -> None:
super().__init__(
level=level, active=active, as_extra=as_extra, tag_keys=tag_keys
)
# A set of all encountered structured logger names. If an application uses
# multiple loggers with different names (eg. different qualnames), then each of
# those loggers needs to be ignored in Sentry's logging integration so that this
Expand Down

0 comments on commit 070b940

Please sign in to comment.