本文整理汇总了Python中pyswing.utils.Logger.Logger._getLogger方法的典型用法代码示例。如果您正苦于以下问题:Python Logger._getLogger方法的具体用法?Python Logger._getLogger怎么用?Python Logger._getLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyswing.utils.Logger.Logger
的用法示例。
在下文中一共展示了Logger._getLogger方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_lotsOfLoggers
# 需要导入模块: from pyswing.utils.Logger import Logger [as 别名]
# 或者: from pyswing.utils.Logger.Logger import _getLogger [as 别名]
def test_lotsOfLoggers(self):
aLogger = Logger._getLogger()
anotherLogger = Logger._getLogger()
self.assertIsNotNone(aLogger, "Check A Logger")
self.assertIsNotNone(anotherLogger, "Check Another Logger")
self.assertEqual(len(anotherLogger.handlers), 1, "Check Handlers")
示例2: test_setLevel
# 需要导入模块: from pyswing.utils.Logger import Logger [as 别名]
# 或者: from pyswing.utils.Logger.Logger import _getLogger [as 别名]
def test_setLevel(self):
aLogger = Logger._getLogger()
Logger.setLevel(logging.INFO)
self.assertEqual(aLogger.level, logging.INFO, "Check Log Level")
Logger.setLevel(logging.DEBUG)
aLogger = Logger._getLogger()
self.assertEqual(aLogger.level, logging.DEBUG, "Check Log Level")
Logger.setLevel(logging.INFO)
示例3: test_log
# 需要导入模块: from pyswing.utils.Logger import Logger [as 别名]
# 或者: from pyswing.utils.Logger.Logger import _getLogger [as 别名]
def test_log(self):
with patch.object(Logger._getLogger(), '_log', return_value=None) as mock_method:
# Assumes that the default log level is DEBUG
Logger.log(logging.DEBUG, "Test Debug Log Entry", {"key1":"value1","key2":"value2"})
self.assertEqual(1, mock_method.call_count)
Logger.log(logging.INFO, "Test Info Log Entry", {"key1":"value1","key2":"value2"})
self.assertEqual(2, mock_method.call_count)
Logger.log(logging.WARN, "Test Warning Log Entry", {"key1":"value1","key2":"value2"})
self.assertEqual(3, mock_method.call_count)
Logger.log(logging.ERROR, "Test Error Log Entry", {"key1":"value1","key2":"value2"})
self.assertEqual(4, mock_method.call_count)
示例4: test_getLogger
# 需要导入模块: from pyswing.utils.Logger import Logger [as 别名]
# 或者: from pyswing.utils.Logger.Logger import _getLogger [as 别名]
def test_getLogger(self):
myLogger = Logger._getLogger()
self.assertIsNotNone(myLogger, "Check My Logger")