Codebase list logbook / 6d5b6d41-baea-4550-8468-50abf853ee3c/main benchmark / bench_noop.py
6d5b6d41-baea-4550-8468-50abf853ee3c/main

Tree @6d5b6d41-baea-4550-8468-50abf853ee3c/main (Download .tar.gz)

bench_noop.py @6d5b6d41-baea-4550-8468-50abf853ee3c/mainraw · history · blame

"""Test with no handler active"""
from logbook import Logger, StreamHandler, NullHandler, ERROR
from cStringIO import StringIO


log = Logger('Test logger')


def run():
    out = StringIO()
    with NullHandler():
        with StreamHandler(out, level=ERROR) as handler:
            for x in xrange(500):
                log.warning('this is not handled')
    assert not out.getvalue()