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))
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')
def log(self, lvl, *args, **kwargs): logger = getLogger(self.name) logger.log(getLevelName(lvl), *args, **kwargs)
def test_getLevelName(self): self.assertEqual(getLevelName('ERROR'), logging.ERROR) self.assertEqual(getLevelName('FATAL'), logging.ERROR) self.assertEqual(getLevelName('OFF'), logging.CRITICAL)