def _setup_logger(self):
        logger = pylogging.getLogger('simple_logger')
        logger.setLevel(pylogging.DEBUG)

        handler = logging.LoggingHandler('test')
        handler.setLevel(pylogging.DEBUG)

        # mock out the sender
        sender = MockSynchronousSender()
        queue = handler.client.channel.queue
        queue.max_queue_length = 1
        queue._sender = sender
        sender.queue = queue

        formatter = pylogging.Formatter(
            '%(name)s - %(levelname)s - %(message)s')
        handler.setFormatter(formatter)
        logger.addHandler(handler)

        return logger, sender
 def test_construct(self):
     handler = logging.LoggingHandler('test')
     self.assertIsNotNone(handler)
     self.assertEqual('test', handler.client.context.instrumentation_key)