Beispiel #1
0
        public void WriteCore(Severity type, object context, string text)
        {
            string loc = MessageSink.LocationString(context);

            if (!string.IsNullOrEmpty(loc))
            {
                text = loc + ": " + text;
            }
            Trace.WriteLine(text, type.ToString());
        }
Beispiel #2
0
        public static void WriteColoredMessage(ConsoleColor color, object context, string text)
        {
            string loc = MessageSink.LocationString(context);

            if (!string.IsNullOrEmpty(loc))
            {
                Console.Write(loc + ": ");
            }

            ConsoleColor oldColor = Console.ForegroundColor;

            Console.ForegroundColor = color;
            Console.WriteLine(text);
            Console.ForegroundColor = oldColor;
        }
Beispiel #3
0
        void WriteCore(Severity type, object context, string text)
        {
            string loc = MessageSink.LocationString(context);

            if (!string.IsNullOrEmpty(loc))
            {
                Console.Write(loc + ": ");
            }

            string       typeText;
            ConsoleColor oldColor = Console.ForegroundColor;

            Console.ForegroundColor = PickColor(type, out typeText);
            if (typeText != null)
            {
                text = typeText + ": " + text;
            }
            Console.WriteLine(text);
            Console.ForegroundColor = oldColor;
        }