本文整理汇总了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()
示例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()
示例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))
示例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"))
示例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))
示例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"))
示例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))
示例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))