public void GetLoggingLevelSettings() { MessageType[] messageTypes = (MessageType[])Enum.GetValues(typeof(MessageType)); for (int i = 0; i < messageTypes.Length; i++) { Config.AddTestSettingValues("LogLevel", messageTypes[i].ToString(), "MagenicMaqs", true); Assert.AreEqual(messageTypes[i], LoggingConfig.GetLoggingLevelSetting()); } }
/// <summary> /// Create a logger /// </summary> /// <returns>A logger</returns> protected ILogger CreateAndSetupLogger(string logName, string logType, LoggingEnabled enabled, bool firstChanceHandler) { try { this.LoggedExceptionList = new List <string>(); this.LoggingEnabledSetting = enabled; // Setup the exception listener if (firstChanceHandler) { AppDomain.CurrentDomain.FirstChanceException += this.FirstChanceHandler; } return(CreateLogger(logName, logType, LoggingConfig.GetLoggingLevelSetting(), enabled)); } catch (Exception e) { ILogger newLogger = LoggerFactory.GetConsoleLogger(); newLogger.LogMessage(MessageType.WARNING, StringProcessor.SafeExceptionFormatter(e)); return(newLogger); } }
public void GetLoggingLevelSettingsDefault() { Config.AddTestSettingValues("LogLevel", "Default", "MagenicMaqs", true); LoggingConfig.GetLoggingLevelSetting(); }