示例#1
0
def no_debug_output(request):
    old = log._level
    log.set_level(log.logging.WARNING)

    def teardown():
        log.set_level(old)

    request.addfinalizer(teardown)
示例#2
0
def no_debug_output(request):
    old = log._level
    log.set_level(log.logging.WARNING)

    def teardown():
        log.set_level(old)

    request.addfinalizer(teardown)
示例#3
0
文件: cli.py 项目: mondonc/vdirsyncer
    def verbose_option(context, verbosity):
        '''
        Basically Python logging levels.

        CRITICAL: Config errors, at most.

        ERROR: Normal errors, at most.

        WARNING: Problems of which vdirsyncer thinks that it can handle them
        itself, but which might crash other clients.

        INFO: Normal output.

        DEBUG: Show e.g. HTTP traffic. Not supposed to be readable by the
        normal user.

        '''
        verbosity = verbosity.upper()
        x = getattr(log.logging, verbosity, None)
        if x is None:
            raise ValueError(u'Invalid verbosity value: {}'.format(verbosity))
        log.set_level(x)
示例#4
0
 def teardown():
     log.set_level(old)
示例#5
0
 def teardown():
     log.set_level(old)