本文整理汇总了Python中sek.logger.SEKLogger.startRecording方法的典型用法代码示例。如果您正苦于以下问题:Python SEKLogger.startRecording方法的具体用法?Python SEKLogger.startRecording怎么用?Python SEKLogger.startRecording使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sek.logger.SEKLogger
的用法示例。
在下文中一共展示了SEKLogger.startRecording方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MSGLoggerTester
# 需要导入模块: from sek.logger import SEKLogger [as 别名]
# 或者: from sek.logger.SEKLogger import startRecording [as 别名]
class MSGLoggerTester(unittest.TestCase):
def setUp(self):
self.logger = SEKLogger(__name__, level='DEBUG')
print 'logger level: %s' % self.logger.loggerLevel
def testInit(self):
self.logger.log('Testing init.',level='info')
self.assertIsNotNone(self.logger)
def testLogRecording(self):
self.logger.log('Testing log recording.','info')
msg = "Recording test."
self.logger.startRecording()
self.logger.log(msg, 'info')
self.logger.endRecording()
self.logger.log("This should not be logged.", 'info')
result = re.search(msg, self.logger.recording).group(0)
self.logger.log("recording result: %s" % self.logger.recording)
self.assertEqual(result, msg)
def testSilentLogging(self):
return
self.logger.log('Testing silent logging.','info')
msg = "Recording test."
self.logger.startRecording()
self.logger.log(msg, 'silent')
self.logger.endRecording()
self.assertEqual(self.logger.recording, '')
def testDebugLogging(self):
self.logger.log('Testing debug logging','DEBUG')
def testDoublingOfLoggingOutput(self):
self.logger.log('This is a test of doubling of logger output at the beginning of a test.')