Package list logbook / debian/1.4.1-1 benchmark / bench_logging_file_handler.py
debian/1.4.1-1

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

bench_logging_file_handler.py @debian/1.4.1-1raw · history · blame

"""Tests logging file handler in comparison"""
from logging import getLogger, FileHandler
from tempfile import NamedTemporaryFile


log = getLogger('Testlogger')


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