Codebase list logbook / 71235d0b-adb4-4b86-8514-d1693dc35069/main benchmark / bench_logging_file_handler.py
71235d0b-adb4-4b86-8514-d1693dc35069/main

Tree @71235d0b-adb4-4b86-8514-d1693dc35069/main (Download .tar.gz)

bench_logging_file_handler.py @71235d0b-adb4-4b86-8514-d1693dc35069/main

9af17e1
 
 
 
 
 
 
 
 
 
 
 
 
 
"""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')