Example #1
0
        public void WriteToConsole(string prompt, ITracingConsole console)
        {
            console.AppendText(Environment.NewLine);
            switch (Level) {
                case TracingLevel.Info:
                    console.TextColor = ConsoleColor.Cyan;
                    console.AppendText(prompt);
                    console.AppendText("#<INFO > ");
                    break;
                case TracingLevel.Warn:
                    console.TextColor = ConsoleColor.Yellow;
                    console.AppendText(prompt);
                    console.AppendText("#<WARN > ");
                    break;
                case TracingLevel.Error:
                    console.TextColor = ConsoleColor.Red;
                    console.AppendText(prompt);
                    console.AppendText("#<ERROR> ");
                    break;
            }

            console.AppendText(EventId.ToString());
            console.AppendText(": ");
            console.AppendText(XmlHelper.MaskInvalidCharacters(Message));
        }
Example #2
0
        public void WriteToConsole(ITracingConsole console)
        {
            console.AppendText(Environment.NewLine);
            switch (Level) {
                case TracingLevel.Info:
                    console.TextColor = ConsoleColor.Gray;
                    console.AppendText("[INFO ] ");
                    break;
                case TracingLevel.Warn:
                    console.TextColor = ConsoleColor.Yellow;
                    console.AppendText("[WARN ] ");
                    break;
                case TracingLevel.Error:
                    console.TextColor = ConsoleColor.Red;
                    console.AppendText("[ERROR] ");
                    break;
            }

            console.AppendText(LoggerName);
            console.AppendText(": ");
            console.AppendText(XmlHelper.MaskInvalidCharacters(Message));

            if (!string.IsNullOrEmpty(Error)) {
                console.AppendText(Environment.NewLine);
                console.AppendText(XmlHelper.MaskInvalidCharacters(Error));
            }
        }