'Similar to :attr:`quiet`, but wraps a whole function.'

def quietfunc(self, function):

    @functools.wraps(function)
    def wrapper(*a, **kw):
        level = 'error'
        if (context.log_level <= logging.DEBUG):
            level = None
        with self.local(function, log_level=level):
            return function(*a, **kw)
    return wrapper
