示例#1
0
 def run_java_aligner(self, ifs):
     lines = list()
     for ifile in ifs:
         lines.append(self.read_lines_from_input_file(ifile))
     lines = zip(*lines)
     _input = [x.strip() for t in lines for x in t]
     for i in _input:
         self.log.debug("input line: %s", i)
     n = len(ifs)
     self.log.debug("starting java client")
     p = JavaAligner(n, getLevelName(self.log.getEffectiveLevel()))
     return p.run("\n".join(_input))
示例#2
0
 def test_setOverrideLogLevel(self):
     initLogging()
     rootLogger = logging.getLogger('')
     somelogger = getLogger('foo.bar')
     somelogger.setLevel(getLevelName('ERROR'))
     setOverrideLogLevel('ERROR')
     self.assertEqual(rootLogger.getEffectiveLevel(), logging.ERROR)
     self.assertEqual(somelogger.getEffectiveLevel(), logging.ERROR)
     notherlogger = getLogger('bar.foo')
     self.assertEqual(notherlogger.getEffectiveLevel(), logging.ERROR)
     setOverrideLogLevel('INFO')
     somelogger = getLogger('foo.bar')
示例#3
0
文件: log.py 项目: cclauss/core
 def log(self, lvl, *args, **kwargs):
     logger = getLogger(self.name)
     logger.log(getLevelName(lvl), *args, **kwargs)
示例#4
0
 def test_getLevelName(self):
     self.assertEqual(getLevelName('ERROR'), logging.ERROR)
     self.assertEqual(getLevelName('FATAL'), logging.ERROR)
     self.assertEqual(getLevelName('OFF'), logging.CRITICAL)