示例#1
0
    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())
示例#2
0
    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())
示例#3
0
    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())
示例#4
0
    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())
示例#5
0
    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()
示例#6
0
    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()
示例#7
0
    def setLogLevel(self, context, level, module):
        LOG.info(_("Received the message for setting log level for %s "), module)

        helper.setLogLevel(level, module)