Ejemplo n.º 1
0
 private void SubscribeLogLevelAndAbove(LogLevel logLevel, IActorRef logger)
 {
     //subscribe to given log level and above
     foreach (LogLevel level in _allLogLevels.Where(l => l >= logLevel))
     {
         Subscribe(logger, Logging.ClassFor(level));
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        ///     Sets up stdout logger.
        /// </summary>
        /// <param name="config">The configuration.</param>
        private void SetUpStdoutLogger(Settings config)
        {
            LogLevel logLevel = Logging.LogLevelFor(config.StdoutLogLevel);

            foreach (LogLevel level in allLogLevels.Where(l => l >= logLevel))
            {
                Subscribe(Logging.StandardOutLogger, Logging.ClassFor(level));
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Sets the log level.
        /// </summary>
        /// <param name="logLevel">The log level.</param>
        public void SetLogLevel(LogLevel logLevel)
        {
            _logLevel = logLevel;
            foreach (IActorRef logger in _loggers)
            {
                //subscribe to given log level and above
                SubscribeLogLevelAndAbove(logLevel, logger);

                //unsubscribe to all levels below loglevel
                foreach (LogLevel level in _allLogLevels.Where(l => l < logLevel))
                {
                    Unsubscribe(logger, Logging.ClassFor(level));
                }
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 ///     Sets the log level.
 /// </summary>
 /// <param name="logLevel">The log level.</param>
 public void SetLogLevel(LogLevel logLevel)
 {
     LogLevel = LogLevel;
     foreach (ActorRef logger in loggers)
     {
         //subscribe to given log level and above
         foreach (LogLevel level in allLogLevels.Where(l => l >= logLevel))
         {
             Subscribe(logger, Logging.ClassFor(level));
         }
         //unsubscribe to all levels below loglevel
         foreach (LogLevel level in allLogLevels.Where(l => l < logLevel))
         {
             Unsubscribe(logger, Logging.ClassFor(level));
         }
     }
 }