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


Python Log.doesLoggerExist方法代码示例

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


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

示例1: set_logLevels

# 需要导入模块: from Acspy.Common import Log [as 别名]
# 或者: from Acspy.Common.Log import doesLoggerExist [as 别名]
    def set_logLevels(self, logger_name, levels):
        """
        Set the default log level for this component.

        Parameter:
        logger_name - name of the component's logger
        levels - maci.LoggingConfigurable.LogLevels instance containing default log level values

        Raises: LoggerDoesNotExistExImpl if the logger is not active.
        """
        if Log.doesLoggerExist(logger_name):
            Log.getLogger(logger_name).setLevels(levels)
        else:
            raise LoggerDoesNotExistExImpl()
开发者ID:,项目名称:,代码行数:16,代码来源:

示例2: get_logLevels

# 需要导入模块: from Acspy.Common import Log [as 别名]
# 或者: from Acspy.Common.Log import doesLoggerExist [as 别名]
    def get_logLevels(self, logger_name):
        """
        Retrieve the log levels for a given component.

        Parameter:
        logger_name - name of the component's logger

        Returns: maci.LoggingConfigurable.LogLevels instance containing the logger's log level values

        Raises: LoggerDoesNotExistExImpl if the logger is not active.
        """
        if Log.doesLoggerExist(logger_name):
            return Log.getLogger(logger_name).getLevels()
        else:
            raise LoggerDoesNotExistExImpl()
开发者ID:,项目名称:,代码行数:17,代码来源:

示例3: testExistsNested

# 需要导入模块: from Acspy.Common import Log [as 别名]
# 或者: from Acspy.Common.Log import doesLoggerExist [as 别名]
 def testExistsNested(self):
     """SeveralLoggerCheck search with the nested child's name as key"""
     self.assertEqual(True, Log.doesLoggerExist(self.cname))
开发者ID:,项目名称:,代码行数:5,代码来源:

示例4: testExistsPartial

# 需要导入模块: from Acspy.Common import Log [as 别名]
# 或者: from Acspy.Common.Log import doesLoggerExist [as 别名]
 def testExistsPartial(self):
     """SeveralLoggerCheck search with part of an exising key"""
     self.assertEqual(False, Log.doesLoggerExist("child"))
开发者ID:,项目名称:,代码行数:5,代码来源:

示例5: testExists

# 需要导入模块: from Acspy.Common import Log [as 别名]
# 或者: from Acspy.Common.Log import doesLoggerExist [as 别名]
 def testExists(self):
     """SeveralLoggerCheck search with parent key"""
     self.assertEqual(True, Log.doesLoggerExist(self.pname))
开发者ID:,项目名称:,代码行数:5,代码来源:

示例6: testWrong

# 需要导入模块: from Acspy.Common import Log [as 别名]
# 或者: from Acspy.Common.Log import doesLoggerExist [as 别名]
 def testWrong(self):
     """SeveralLoggerCheck Search with non-existing key"""
     self.assertEqual(False, Log.doesLoggerExist("blah"))
开发者ID:,项目名称:,代码行数:5,代码来源:

示例7: testUnnamedLoggerExists

# 需要导入模块: from Acspy.Common import Log [as 别名]
# 或者: from Acspy.Common.Log import doesLoggerExist [as 别名]
 def testUnnamedLoggerExists(self):
     """OneLoggerCheck unnamed logger found by search"""
     self.assertEqual(True, Log.doesLoggerExist(self.mylogger.name))
开发者ID:,项目名称:,代码行数:5,代码来源:

示例8: testNone

# 需要导入模块: from Acspy.Common import Log [as 别名]
# 或者: from Acspy.Common.Log import doesLoggerExist [as 别名]
 def testNone(self):
     """NoLoggerCheck logger search with no key"""
     self.assertEqual(False, Log.doesLoggerExist(None))
开发者ID:,项目名称:,代码行数:5,代码来源:


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