/torn/application.py
Python | 18 lines | 10 code | 2 blank | 6 comment | 2 complexity | 11a773dfc9f71cbd41aeae3bbef2cb59 MD5 | raw file
- from tornado.web import Application as TornadoApp
- from util import setLoggerLevel
- import logging
- class Application(TornadoApp):
- """ Simply reserving the right to override aspects
- of the base Application class at another point, and
- set the basic logger level until we find a better
- way.
- """
- def __init__(self, *args, **kwargs):
- # set logger level if provided
- loglevel = kwargs.get('loglevel')
- if loglevel and loglevel != "none":
- base_logger = logging.getLogger()
- setLoggerLevel(base_logger, loglevel)
- super(type(self), self).__init__(*args, **kwargs)