Package list logbook / upstream/1.4.2 benchmark / bench_logging_file_handler.py
upstream/1.4.2

Tree @upstream/1.4.2 (Download .tar.gz)

bench_logging_file_handler.py @upstream/1.4.2raw · 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')