Пример #1
0
    def get_logging_enabled_setting(self):
        enabledSetting = Config.getGeneralValue("Log", "NO").toUpperCase()

        if enabledSetting == "YES":
            return LoggingEnabled.YES
        elif enabledSetting == "ONFAIL":
            return LoggingEnabled.ONFAIL
        elif enabledSetting == "NO":
            return LoggingEnabled.NO
        else:
            raise ValueError(
                StringProcessor.safeFormatter(
                    "Log value %s is not a valid option",
                    Config.get_general_value("Log", "NO")))
Пример #2
0
    def get_logger(self, fileName):
        # Disable logging means we just send any logged messages to the console
        if (get_logging_enabled_setting() == LoggingEnabled.NO):
            return ConsoleLogger()

        logDirectory = get_log_directory()
        loggingLevel = get_logging_level_setting()
        logType = Config.getGeneralValue("LogType", "CONSOLE").toUpperCase()

        if logType == "CONSOLE":
            return ConsoleLogger(loggingLevel)
        elif logType == "TXT":
            return FileLogger(False, logDirectory, fileName, loggingLevel)
        else:
            raise ValueError(
                StringProcessor.safeFormatter(
                    "Log type %s is not a valid option",
                    Config.get_general_value("LogType", "CONSOLE")))
Пример #3
0
 def get_timeout_time(self):
   return Config.get_general_value("BrowserTimeout", "0")
Пример #4
0
 def get_wait_time(self):
   return Config.get_general_value("BrowserWaitTime", "0")
Пример #5
0
 def get_log_directory(self):
     path = os.path.abspath("").concat("\\Logs")
     return Config.get_general_value("FileLoggerPath", path)