Package list logbook / debian/0.10.0-1 benchmark / bench_file_handler.py
debian/0.10.0-1

Tree @debian/0.10.0-1 (Download .tar.gz)

bench_file_handler.py @debian/0.10.0-1raw · history · blame

"""Benchmarks the file handler"""
from logbook import Logger, FileHandler
from tempfile import NamedTemporaryFile


log = Logger('Test logger')


def run():
    f = NamedTemporaryFile()
    with FileHandler(f.name) as handler:
        for x in xrange(500):
            log.warning('this is handled')