Пример #1
0
        protected override void Write(LogEventInfo logEvent)
        {
            var logMessage = this.Layout.Render(logEvent);

            logMessage += "\n";
            if (logEvent.Level == LogLevel.Warn)
            {
                _consoleControl.WriteOutput(logMessage, Colors.Yellow);
            }
            else if (logEvent.Level == LogLevel.Error)
            {
                _consoleControl.WriteOutput(logMessage, Colors.Red);
            }
            else
            {
                _consoleControl.WriteOutput(logMessage, Colors.White);
            }

            /*
             * if (logEvent.Level == LogLevel.Warn)
             *  Debug.LogWarning(logMessage);
             * else if (logEvent.Level == LogLevel.Error || logEvent.Level == LogLevel.Fatal)
             *  Debug.LogError(logMessage);
             * else
             *  Debug.Log(logMessage);
             */
        }
Пример #2
0
 public override void Write(string value)
 {
     control?.WriteOutput(value, Color.FromRgb(255, 255, 255));
 }