# Path: grappa/log.py



import logging
import functools
from .log import log

    # Default options store
    defaults = {
        # Debug enables internal logging. Defaults to False.
        'debug': False,
        # show_code enables/disables code output in errors.
        'show_code': True,
        # colors enables/disables colored ANSI sequences for the terminal
        'use_colors': True
    }

    # List of supported configuration names
    allowed_opts = defaults.keys()

    def __init__(self):
        self.__dict__['opts'] = self.defaults.copy()

    @validate
    def __getattr__(self, name):
        return self.opts.get(name)

    @validate
    def __setattr__(self, name, value):
        self.opts[name] = value

        # Configure logger level
        if name == 'debug':
            log.setLevel(logging.DEBUG if value is True
                         else logging.CRITICAL)


# Path: grappa/log.py



# Path: grappa/config.py
import logging
import functools
from .log import log


    # Default options store
    defaults = {
        # Debug enables internal logging. Defaults to False.
        'debug': False,
        # show_code enables/disables code output in errors.
        'show_code': True,
        # colors enables/disables colored ANSI sequences for the terminal
        'use_colors': True
    }

    # List of supported configuration names
    allowed_opts = defaults.keys()

    def __init__(self):
        self.__dict__['opts'] = self.defaults.copy()

    @validate
    def __getattr__(self, name):
        return self.opts.get(name)

    @validate
    def __setattr__(self, name, value):
        self.opts[name] = value

        # Configure logger level
        if name == 'debug':
            log.setLevel(logging.DEBUG if value is True
                         else logging.CRITICAL)


        log.debug('[config] set option {}="{}"'.format(name, value))