Exemplo n.º 1
0
    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'))
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
    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))
Exemplo n.º 4
0
    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))
Exemplo n.º 5
0
    def logging(self):
        ''' Named logging pipe. '''

        return debug.AppToolsLogger(path='appfactory.integration.upstream',
                                    name='UpstreamBus')._setcondition(
                                        self.config.get('debug', False))
Exemplo n.º 6
0
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'