Exemplo n.º 1
0
        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());
            }
        }
Exemplo n.º 2
0
        /// <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);
            }
        }
Exemplo n.º 3
0
 public void GetLoggingLevelSettingsDefault()
 {
     Config.AddTestSettingValues("LogLevel", "Default", "MagenicMaqs", true);
     LoggingConfig.GetLoggingLevelSetting();
 }