def __init__(self, level=logging.NOTSET): logging.Handler.__init__(self, level=level) self.connection = None self.channel = None self.connection, self.channel, self.exchange = amqp_connect() self.producer = kombu.messaging.Producer(self.channel, self.exchange, serializer='json')
def _initialize(): """Initialize amqp artefacts.""" _, channel, exchange = amqp_connect() return kombu.messaging.Producer(channel, exchange, serializer='json')