Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Compute log level and make sure that the result is in DEBUG..ERROR.

>>> changeLogLevel(ERROR, -1) == WARNING
True
>>> changeLogLevel(DEBUG, 1) == INFO
True

        def changeLogLevel(level, delta):
    """
    Compute log level and make sure that the result is in DEBUG..ERROR.

    >>> changeLogLevel(ERROR, -1) == WARNING
    True
    >>> changeLogLevel(DEBUG, 1) == INFO
    True
    """
    return minmax(DEBUG, level + delta*10, ERROR)
        


src/s/e/segvault-HEAD/fusil/ptrace/ptrace/error.py   segvault(Download)
from sys import exc_info
from traceback import format_exception
from logging import ERROR, getLogger
from ptrace.logging_tools import getLogFunc, changeLogLevel
 
    log_func = getLogFunc(logger, log_level)
    log_func("%s: %s" % (title, formatError(error)))
    writeBacktrace(logger, log_level=changeLogLevel(log_level, -1))
 
class PtraceError(Exception):

src/p/y/python-ptrace-0.7/ptrace/error.py   python-ptrace(Download)
from sys import exc_info
from traceback import format_exception
from logging import ERROR, getLogger
from ptrace.logging_tools import getLogFunc, changeLogLevel
 
    log_func = getLogFunc(logger, log_level)
    log_func("%s: %s" % (title, formatError(error)))
    writeBacktrace(logger, log_level=changeLogLevel(log_level, -1))
 
class PtraceError(Exception):