

def testLogging(self):
    ' Simple logging example '
    log = logging.getLogger('')
    log.setLevel(logging.DEBUG)
    log.addHandler(MongoHandler(self.collection))
    log.debug('test')
    r = self.collection.find_one({
        'levelname': 'DEBUG',
        'msg': 'test',
    })
    self.assertEquals(r['msg'], 'test')

dataset/ETHPy150Open andreisavu/mongodb-log/tests/test_handler.py TestRootLoggerHandler.testLogging/original