Ejemplo n.º 1
0
    def set_logLevels(self, logger_name, levels):
        """
        Set the default log level for this component.

        Parameter:
        logger_name - name of the component's logger
        levels - maci.LoggingConfigurable.LogLevels instance containing default log level values

        Raises: LoggerDoesNotExistExImpl if the logger is not active.
        """
        if Log.doesLoggerExist(logger_name):
            Log.getLogger(logger_name).setLevels(levels)
        else:
            raise LoggerDoesNotExistExImpl()
Ejemplo n.º 2
0
    def get_logLevels(self, logger_name):
        """
        Retrieve the log levels for a given component.

        Parameter:
        logger_name - name of the component's logger

        Returns: maci.LoggingConfigurable.LogLevels instance containing the logger's log level values

        Raises: LoggerDoesNotExistExImpl if the logger is not active.
        """
        if Log.doesLoggerExist(logger_name):
            return Log.getLogger(logger_name).getLevels()
        else:
            raise LoggerDoesNotExistExImpl()
Ejemplo n.º 3
0
 def testExistsNested(self):
     """SeveralLoggerCheck search with the nested child's name as key"""
     self.assertEqual(True, Log.doesLoggerExist(self.cname))
Ejemplo n.º 4
0
 def testExistsPartial(self):
     """SeveralLoggerCheck search with part of an exising key"""
     self.assertEqual(False, Log.doesLoggerExist("child"))
Ejemplo n.º 5
0
 def testExists(self):
     """SeveralLoggerCheck search with parent key"""
     self.assertEqual(True, Log.doesLoggerExist(self.pname))
Ejemplo n.º 6
0
 def testWrong(self):
     """SeveralLoggerCheck Search with non-existing key"""
     self.assertEqual(False, Log.doesLoggerExist("blah"))
Ejemplo n.º 7
0
 def testUnnamedLoggerExists(self):
     """OneLoggerCheck unnamed logger found by search"""
     self.assertEqual(True, Log.doesLoggerExist(self.mylogger.name))
Ejemplo n.º 8
0
 def testNone(self):
     """NoLoggerCheck logger search with no key"""
     self.assertEqual(False, Log.doesLoggerExist(None))
Ejemplo n.º 9
0
 def testExistsNested(self):
     """SeveralLoggerCheck search with the nested child's name as key"""
     self.assertEqual(True, Log.doesLoggerExist(self.cname))
Ejemplo n.º 10
0
 def testExistsPartial(self):
     """SeveralLoggerCheck search with part of an exising key"""
     self.assertEqual(False, Log.doesLoggerExist("child"))
Ejemplo n.º 11
0
 def testExists(self):
     """SeveralLoggerCheck search with parent key"""
     self.assertEqual(True, Log.doesLoggerExist(self.pname))
Ejemplo n.º 12
0
 def testWrong(self):
     """SeveralLoggerCheck Search with non-existing key"""
     self.assertEqual(False, Log.doesLoggerExist("blah"))
Ejemplo n.º 13
0
 def testUnnamedLoggerExists(self):
     """OneLoggerCheck unnamed logger found by search"""
     self.assertEqual(True, Log.doesLoggerExist(self.mylogger.name))
Ejemplo n.º 14
0
 def testNone(self):
     """NoLoggerCheck logger search with no key"""
     self.assertEqual(False, Log.doesLoggerExist(None))