lib: discard all log messages from dbbackup

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-04-10 23:20:20 +02:00
parent 97364ad102
commit 19e73630ab
1 changed files with 4 additions and 1 deletions

View File

@ -22,7 +22,7 @@ class SentryIgnoredException(Exception):
"""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"""
ignored_classes = (
# Inbuilt types
@ -64,4 +64,7 @@ def before_send(event, hint):
_, exc_value, _ = hint["exc_info"]
if isinstance(exc_value, ignored_classes):
return None
if "logger" in event:
if event["logger"] in ["dbbackup"]:
return None
return event