Package list logbook / e34acae9-f9c1-4d2a-a7b9-91f24ff2b00b/main benchmark / bench_logging_file_handler.py
e34acae9-f9c1-4d2a-a7b9-91f24ff2b00b/main

Tree @e34acae9-f9c1-4d2a-a7b9-91f24ff2b00b/main (Download .tar.gz)

bench_logging_file_handler.py @e34acae9-f9c1-4d2a-a7b9-91f24ff2b00b/mainraw · 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')