import logging


class ExceptionFilter(logging.Filter):
    def __init__(self, debug=None):
        self.debug = debug

    def filter(self, record):
        if self.debug:
            return True

        # clear exceptions when not in debug
        if record.levelname == 'ERROR' and record.exc_info:
            record.exc_info = None
        return True

LOGGING = {
    'version': 1,
    'filters': {
        'exc_filter': {
            '()': ExceptionFilter,
            'debug': False
        }
    },
    'handlers': {
        'console': {
            'class': 'logging.StreamHandler',
            'filters': ['exc_filter']
        }
    },
    'loggers': {
        'bamp': {
            'level': 'DEBUG',
            'handlers': ['console']
        },
    }
}

@@ -16,25 +16,21 @@
 %0A%0Aclass 
-Exception
+Debug
 Filter(l
@@ -186,25 +186,24 @@
 rn True%0A
-%0A
         
 # clear 
@@ -198,158 +198,19 @@
     
-# clear exceptions when not in debug%0A        if record.levelname == 'ERROR' and record.exc_info:%0A            record.exc_info = None%0A        return Tru
+return Fals
 e%0A%0AL
@@ -301,17 +301,13 @@
 )': 
-Exception
+Debug
 Filt

Disable printing error messages not in debug