当前位置: 首页>>代码示例>>Python>>正文


Python logging.logMultiprocessing方法代码示例

本文整理汇总了Python中logging.logMultiprocessing方法的典型用法代码示例。如果您正苦于以下问题:Python logging.logMultiprocessing方法的具体用法?Python logging.logMultiprocessing怎么用?Python logging.logMultiprocessing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在logging的用法示例。


在下文中一共展示了logging.logMultiprocessing方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: config_logging

# 需要导入模块: import logging [as 别名]
# 或者: from logging import logMultiprocessing [as 别名]
def config_logging(level=LEVEL, prefix=PREFIX, other_loggers=None):
    # Little speed up
    if "%(process)d" not in prefix:
        logging.logProcesses = False
    if "%(processName)s" not in prefix:
        logging.logMultiprocessing = False
    if "%(thread)d" not in prefix and "%(threadName)s" not in prefix:
        logging.logThreads = False
    handler = logging.StreamHandler()
    handler.setFormatter(LogFormatter())
    loggers = [logging.getLogger('pyftpdlib')]
    if other_loggers is not None:
        loggers.extend(other_loggers)
    for logger in loggers:
        logger.setLevel(level)
        logger.addHandler(handler) 
开发者ID:aliyun,项目名称:oss-ftp,代码行数:18,代码来源:log.py

示例2: test_optional

# 需要导入模块: import logging [as 别名]
# 或者: from logging import logMultiprocessing [as 别名]
def test_optional(self):
        r = logging.makeLogRecord({})
        NOT_NONE = self.assertIsNotNone
        if threading:
            NOT_NONE(r.thread)
            NOT_NONE(r.threadName)
        NOT_NONE(r.process)
        NOT_NONE(r.processName)
        log_threads = logging.logThreads
        log_processes = logging.logProcesses
        log_multiprocessing = logging.logMultiprocessing
        try:
            logging.logThreads = False
            logging.logProcesses = False
            logging.logMultiprocessing = False
            r = logging.makeLogRecord({})
            NONE = self.assertIsNone
            NONE(r.thread)
            NONE(r.threadName)
            NONE(r.process)
            NONE(r.processName)
        finally:
            logging.logThreads = log_threads
            logging.logProcesses = log_processes
            logging.logMultiprocessing = log_multiprocessing 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:27,代码来源:test_logging.py

示例3: logf

# 需要导入模块: import logging [as 别名]
# 或者: from logging import logMultiprocessing [as 别名]
def logf(logger_func):
    @wraps(logger_func)
    def log_wrapper(*args):
        if DEBUG:
            logProcesses = logging.logProcesses
            logThreads = logging.logThreads
            logMultiprocessing = logging.logMultiprocessing
            logging.logThreads = logging.logProcesses = logMultiprocessing = False
            # disable logging pids and tids - we don't want extra calls around, especilly when we monkeypatch stuff
            try:
                return logger_func(*args)
            finally:
                logging.logProcesses = logProcesses
                logging.logThreads = logThreads
                logging.logMultiprocessing = logMultiprocessing
    return log_wrapper 
开发者ID:ionelmc,项目名称:python-aspectlib,代码行数:18,代码来源:utils.py

示例4: config_logging

# 需要导入模块: import logging [as 别名]
# 或者: from logging import logMultiprocessing [as 别名]
def config_logging(level=LEVEL, prefix=PREFIX, other_loggers=None):
    # Little speed up
    if "(process)" not in prefix:
        logging.logProcesses = False
    if "%(processName)s" not in prefix:
        logging.logMultiprocessing = False
    if "%(thread)d" not in prefix and "%(threadName)s" not in prefix:
        logging.logThreads = False
    handler = logging.StreamHandler()
    formatter = LogFormatter()
    formatter.PREFIX = prefix
    handler.setFormatter(formatter)
    loggers = [logging.getLogger('pyftpdlib')]
    if other_loggers is not None:
        loggers.extend(other_loggers)
    for logger in loggers:
        logger.setLevel(level)
        logger.addHandler(handler) 
开发者ID:giampaolo,项目名称:pyftpdlib,代码行数:20,代码来源:log.py


注:本文中的logging.logMultiprocessing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。