lib: discard all log messages from dbbackup
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
97364ad102
commit
19e73630ab
|
@ -22,7 +22,7 @@ class SentryIgnoredException(Exception):
|
||||||
"""Base Class for all errors that are suppressed, and not sent to sentry."""
|
"""Base Class for all errors that are suppressed, and not sent to sentry."""
|
||||||
|
|
||||||
|
|
||||||
def before_send(event, hint):
|
def before_send(event: dict, hint: dict) -> dict:
|
||||||
"""Check if error is database error, and ignore if so"""
|
"""Check if error is database error, and ignore if so"""
|
||||||
ignored_classes = (
|
ignored_classes = (
|
||||||
# Inbuilt types
|
# Inbuilt types
|
||||||
|
@ -64,4 +64,7 @@ def before_send(event, hint):
|
||||||
_, exc_value, _ = hint["exc_info"]
|
_, exc_value, _ = hint["exc_info"]
|
||||||
if isinstance(exc_value, ignored_classes):
|
if isinstance(exc_value, ignored_classes):
|
||||||
return None
|
return None
|
||||||
|
if "logger" in event:
|
||||||
|
if event["logger"] in ["dbbackup"]:
|
||||||
|
return None
|
||||||
return event
|
return event
|
||||||
|
|
Reference in New Issue