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()
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()
def testExistsNested(self): """SeveralLoggerCheck search with the nested child's name as key""" self.assertEqual(True, Log.doesLoggerExist(self.cname))
def testExistsPartial(self): """SeveralLoggerCheck search with part of an exising key""" self.assertEqual(False, Log.doesLoggerExist("child"))
def testExists(self): """SeveralLoggerCheck search with parent key""" self.assertEqual(True, Log.doesLoggerExist(self.pname))
def testWrong(self): """SeveralLoggerCheck Search with non-existing key""" self.assertEqual(False, Log.doesLoggerExist("blah"))
def testUnnamedLoggerExists(self): """OneLoggerCheck unnamed logger found by search""" self.assertEqual(True, Log.doesLoggerExist(self.mylogger.name))
def testNone(self): """NoLoggerCheck logger search with no key""" self.assertEqual(False, Log.doesLoggerExist(None))