I’m trying to add sentry logging to my application.
My imports is:
import sys
import traceback
import hashlib
import yaml
import logging
from subprocess import check_call, call
from raven import Client
from raven.handlers.logging import SentryHandler
from raven.conf import setup_logging
My code is:
sentryEnable = bool(config["sentryEnable"])
if sentryEnable:
sentryDSN = config["sentryDSN"]
print("Sentry reporting enabled, sentry DSN was found in config")
sentryClient = Client(sentryDSN)
sentryHandler = SentryHandler(sentryClient)
setup_logging(SentryHandler)
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
Error:
AttributeError: type object 'SentryHandler' has no attribute 'level'
So, where am I wrong, and what should I do with it. How can i fix it?