Beispiel #1
0
        private void SetupStandardOutLogger(StandardOutLogger stdOutLogger, IStandardOutLoggerSettings settings)
        {
            var logLevel   = settings.LogLevel;
            var dateFormat = settings.DateFormat;

            if (!Log.IsValidLogLevel(logLevel))
            {
                StandardOutLoggerHelper.PrintError(new ErrorLogEvent(GetType().Name, GetType(), string.Format("Unknown StandardOutLogger LogLevel setting: {0}, defaulting to Error", logLevel), new LoggingException()), dateFormat);
                logLevel = LogLevel.Error;
            }
            Log.GetSubscribeLevels(logLevel).ForEach(level => Subscribe(stdOutLogger, level.Type));
            _lock.Write(() =>
            {
                _loggers.Add(stdOutLogger);
                _logLevels = logLevel;
            });
        }
Beispiel #2
0
 public void StartStandardOutLogger(StandardOutLogger standardOutLogger, IStandardOutLoggerSettings settings)
 {
     _stdOutLogger = standardOutLogger;
     SetupStandardOutLogger(standardOutLogger, settings);
     Publish(new DebugLogEvent(GetType().Name, GetType(), "StandardOutLogger started"));
 }