Пример #1
0
        protected virtual void _WriteLine(string value)
        {
            Debug.WriteLine(value);

            if (AlsoWriteToOriginalConsoleOut && OriginalConsoleOut != null)
            {
                OriginalConsoleOut.WriteLine(value);
            }

            if (swriter != null)
            {
                swriter.WriteLine(value);
            }
        }
Пример #2
0
            public void Log(LogLevel level, string content)
            {
                try
                {
                    ConsoleColor fg;
                    if (colorMap.TryGetValue(level, out fg))
                    {
                        Console.ForegroundColor = fg;
                    }

                    OriginalConsoleOut.WriteLine(string.Format("{0} {1}", level.ToLogString(), content));
                }
                finally
                {
                    Console.ResetColor();
                }
            }