Akka.Event.StandardOutLogger.PrintLogEvent C# (CSharp) Метод

PrintLogEvent() публичный статический Метод

Prints the LogEvent using the StandardOutWriter.
public static PrintLogEvent ( LogEvent logEvent ) : void
logEvent LogEvent
Результат void
        public static void PrintLogEvent(LogEvent logEvent)
        {
            ConsoleColor? color = null;
            
            if(UseColors)
            {
                var logLevel = logEvent.LogLevel();
                switch(logLevel)
                {
                    case LogLevel.DebugLevel:
                        color = DebugColor;
                        break;
                    case LogLevel.InfoLevel:
                        color = InfoColor;
                        break;
                    case LogLevel.WarningLevel:
                        color = WarningColor;
                        break;
                    case LogLevel.ErrorLevel:
                        color = ErrorColor;
                        break;
                }
            }

            StandardOutWriter.WriteLine(logEvent.ToString(), color);
        }
    }

Usage Example

Пример #1
0
 /// <summary>
 /// Print the specified log event.
 /// </summary>
 /// <param name="logEvent">The log event that is to be output.</param>
 protected virtual void Print(LogEvent logEvent)
 {
     StandardOutLogger.PrintLogEvent(logEvent);
 }