Codebase list logbook / dfa95965-8197-4cf9-bb97-92fb2ac480cd/main benchmark / bench_logging_file_handler.py
dfa95965-8197-4cf9-bb97-92fb2ac480cd/main

Tree @dfa95965-8197-4cf9-bb97-92fb2ac480cd/main (Download .tar.gz)

bench_logging_file_handler.py @dfa95965-8197-4cf9-bb97-92fb2ac480cd/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')