def test_set_log_level_AUDIT(self): self.log = log.getLogger('healthnmon.example') self.assertEqual(logging.INFO, self.log.logger.getEffectiveLevel()) helper.setLogLevel('AUDIT', 'healthnmon.example') self.assertEqual(log.logging.AUDIT, self.log.logger.getEffectiveLevel())
def test_set_log_level_AUDIT(self): self.log = log.getLogger('healthnmon.example') self.assertEqual(logging.INFO, self.log.logger.getEffectiveLevel()) helper.setLogLevel('AUDIT', 'healthnmon.example') self.assertEqual( log.logging.AUDIT, self.log.logger.getEffectiveLevel())
def test_set_log_level_healthnmon_invalid_loglevel(self): self.log = log.getLogger('healthnmon.example') self.assertEqual(logging.INFO, self.log.logger.getEffectiveLevel()) helper.setLogLevel('test', 'healthnmon') self.assertNotEqual(logging.DEBUG, self.log.logger.getEffectiveLevel()) self.assertNotEqual(logging.DEBUG, logging.getLogger().getEffectiveLevel())
def test_set_log_level_healthnmon_invalid_loglevel(self): self.log = log.getLogger('healthnmon.example') self.assertEqual(logging.INFO, self.log.logger.getEffectiveLevel()) helper.setLogLevel('test', 'healthnmon') self.assertNotEqual(logging.DEBUG, self.log.logger.getEffectiveLevel()) self.assertNotEqual( logging.DEBUG, logging.getLogger().getEffectiveLevel())
def test_log_level(self): self._createInvCache() self.mox.StubOutWithMock(helper, 'setLogLevel') helper.setLogLevel(mox.IgnoreArg(), mox.IgnoreArg()) self.mox.ReplayAll() self.manager.setLogLevel(self.context, 'DEBUG', "test_module") self.mox.VerifyAll() self.mox.UnsetStubs()
def setLogLevel(self, context, level, module): LOG.info(_("Received the message for setting log level for %s "), module) helper.setLogLevel(level, module)