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


Python logging._checkLevel方法代码示例

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


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

示例1: common_logger_config

# 需要导入模块: import logging [as 别名]
# 或者: from logging import _checkLevel [as 别名]
def common_logger_config(self, logger, config, incremental=False):
        """
        Perform configuration which is common to root and non-root loggers.
        """
        level = config.get('level', None)
        if level is not None:
            logger.setLevel(logging._checkLevel(level))
        if not incremental:
            #Remove any existing handlers
            for h in logger.handlers[:]:
                logger.removeHandler(h)
            handlers = config.get('handlers', None)
            if handlers:
                self.add_handlers(logger, handlers)
            filters = config.get('filters', None)
            if filters:
                self.add_filters(logger, filters) 
开发者ID:war-and-code,项目名称:jawfish,代码行数:19,代码来源:config.py

示例2: _checkLevel

# 需要导入模块: import logging [as 别名]
# 或者: from logging import _checkLevel [as 别名]
def _checkLevel(level):
        if isinstance(level, int):
            rv = level
        elif str(level) == level:
            if level not in logging._levelNames:
                raise ValueError('Unknown level: %r' % level)
            rv = logging._levelNames[level]
        else:
            raise TypeError('Level not an integer or a '
                            'valid string: %r' % level)
        return rv

# The ConvertingXXX classes are wrappers around standard Python containers,
# and they serve to convert any suitable values in the container. The
# conversion converts base dicts, lists and tuples to their wrapped
# equivalents, whereas strings which match a conversion format are converted
# appropriately.
#
# Each wrapper should have a configurator attribute holding the actual
# configurator to use for conversion. 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:22,代码来源:dictconfig.py

示例3: common_logger_config

# 需要导入模块: import logging [as 别名]
# 或者: from logging import _checkLevel [as 别名]
def common_logger_config(self, logger, config, incremental=False):
        """
        Perform configuration which is common to root and non-root loggers.
        """
        level = config.get('level', None)
        if level is not None:
            logger.setLevel(_checkLevel(level))
        if not incremental:
            # Remove any existing handlers
            for h in logger.handlers[:]:
                logger.removeHandler(h)
            handlers = config.get('handlers', None)
            if handlers:
                self.add_handlers(logger, handlers)
            filters = config.get('filters', None)
            if filters:
                self.add_filters(logger, filters) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:19,代码来源:dictconfig.py

示例4: common_logger_config

# 需要导入模块: import logging [as 别名]
# 或者: from logging import _checkLevel [as 别名]
def common_logger_config(self, logger, config, incremental=False):
        """
        Perform configuration which is common to root and non-root loggers.
        """
        level = config.get('level', None)
        if level is not None:
            logger.setLevel(_checkLevel(level))
        if not incremental:
            #Remove any existing handlers
            for h in logger.handlers[:]:
                logger.removeHandler(h)
            handlers = config.get('handlers', None)
            if handlers:
                self.add_handlers(logger, handlers)
            filters = config.get('filters', None)
            if filters:
                self.add_filters(logger, filters) 
开发者ID:soravux,项目名称:scoop,代码行数:19,代码来源:dictconfig.py


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