def logging(self): ''' Cached access to dedicated log pipe. ''' path = self._config_path.split('.') return debug.AppToolsLogger(path='.'.join(path[0:-1]), name=path[-1])._setcondition( self.config.get('debug'))
def logging(self): ''' Named logging pipe / shortcut. :returns: Customized log pipe, with ``path``, ``name`` and ``condition`` set according to config. ''' return debug.AppToolsLogger( path='api.handlers', name='WebHandler')._setcondition(config.debug)
def logging(self): ''' Named logging pipe. Reads :py:attr:`PlatformBridge._config_path` to produce a customized log pipe. :returns: A brand new :py:class:`apptools.debug.AppToolsLogger`, with the current ``path``/``name``/``condition`` set. ''' return debug.AppToolsLogger(**{ 'path': self.__module__, 'name': self.__class__.__name__ })._setcondition(self.config.get('debug', True))
def logging(self): ''' Named logging pipe. Reads :py:attr:`PlatformBridge._config_path` to produce a customized log pipe. :returns: A brand new :py:class:`apptools.debug.AppToolsLogger`, with the current ``path``/``name``/``condition`` set. ''' _split = self._config_path.split('.') return debug.AppToolsLogger(**{ 'path': '.'.join(_split[0:-1]), 'name': _split[-1] })._setcondition(self.config.get('debug', True))
def logging(self): ''' Named logging pipe. ''' return debug.AppToolsLogger(path='appfactory.integration.upstream', name='UpstreamBus')._setcondition( self.config.get('debug', False))
from coolapp.handlers import * from coolapp.services import * from coolapp.platforms import * try: from coolapp.templates import * except AttributeError: pass # apptools util from apptools.util import cli from apptools.util import debug from apptools.util import devserver ## Globals logging = debug.AppToolsLogger(name='web') class Web(cli.Tool): ''' Minimal toolchain for managing and developing an apptools-based web application. ''' arguments = (('--debug', '-d', { 'action': 'store_true', 'help': 'run in debug mode' }), ('--quiet', '-q', { 'action': 'store_true', 'help': 'suppress most output' }), ('--verbose', '-v', { 'action': 'count', 'help': 'output a lot of useful info'