'Decides whether we should log a record'

def filter(self, record):

    if (record.levelno < logging.INFO):
        if record.msg.startswith('DB:'):
            return config.DEBUG_DB
        return config.DEBUG
    if (record.levelno != logging.WARNING):
        return True
    if (record.msg in self.warnings):
        return False
    if (len(self.warnings) > self.MAX_WARNINGS_STORED):
        self.warnings = set()
    self.warnings.add(record.msg)
    return True
