def test_logging_handler(self): """ initial log level for ion.process.event is INFO -- test we can change it to TRACE """ config.replace_configuration(os.path.join(TEST_DIR, 'logging.yml')) log.debug('this should probably not be logged') self.assertFalse(log.isEnabledFor(TRACE)) # handler = pyon.container.management.LogLevelHandler() action = IonObject(OT.ChangeLogLevel, logger='pyon.container', level='TRACE') handler.handle_request(action) # self.assertTrue(log.isEnabledFor(TRACE))
def test_logging_clear(self): """ initial log level for ion.process.event is INFO -- test that we can clear it (root level WARN should apply) """ config.replace_configuration(os.path.join(TEST_DIR, 'logging.yml')) log.debug('this should probably not be logged') self.assertTrue(log.isEnabledFor(logging.INFO), msg=repr(log.__dict__)) # handler = pyon.container.management.LogLevelHandler() action = IonObject(OT.ChangeLogLevel, logger='pyon.container', level='WARN') handler.handle_request(action) self.assertFalse(log.isEnabledFor(logging.INFO))