Package list logbook / 6d5b6d41-baea-4550-8468-50abf853ee3c/main benchmark / bench_noop_filter.py
6d5b6d41-baea-4550-8468-50abf853ee3c/main

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

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

from logbook import Logger, StreamHandler, NullHandler
from cStringIO import StringIO


log = Logger('Test logger')


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