예제 #1
0
 public static void Log(string message, params object[] args)
 {
     if (args.Any())
     {
         message = String.Format(message, args);
     }
     Console.WriteLine("{0}{1}"
                       , ConsoleTime.GetTime(DateTime.Now)
                       , message);
 }
예제 #2
0
        public static void Warn(string message, params object[] args)
        {
            if (args.Any())
            {
                message = String.Format(message, args);
            }
            ConsoleColor currentColor = Console.ForegroundColor;

            Console.ForegroundColor = ConsoleColor.DarkYellow;
            Console.WriteLine("{0}Warn: {1}"
                              , ConsoleTime.GetTime(DateTime.Now)
                              , message);
            Console.ForegroundColor = currentColor;
        }
예제 #3
0
        public static void Error(string message, params object[] args)
        {
            if (args.Any())
            {
                message = String.Format(message, args);
            }
            ConsoleColor currentColor = Console.ForegroundColor;

            Console.ForegroundColor = ConsoleColor.DarkRed;
            Console.WriteLine("{0}Error: {1}"
                              , ConsoleTime.GetTime(DateTime.Now)
                              , message);
            Console.ForegroundColor = currentColor;
            Environment.Exit(-1);
        }