示例#1
0
 public static void Assert(bool condition, Util.Reflect.Info stackInfo, string text, params object[] args)
 {
     if (!condition)
     {
         _Print(stackInfo, ConsoleColor.DarkRed, "Assert", text, args);
         throw new Exception(string.Format(text, args));
     }
 }
示例#2
0
        private static void _Print(Util.Reflect.Info stackInfo, ConsoleColor color, string title, string text, params object[] args)
        {
            Console.ForegroundColor = color;
            var info = string.Format("[Sumi {0}]:{1}/{2}({3})",
                                     title,
                                     stackInfo.ClassName,
                                     stackInfo.MethodName,
                                     stackInfo.MethodLineNo);
            var message = string.Format("{0}: \"{1}\"", info, text);

            Console.WriteLine(message, args);
            Console.ResetColor();
        }
示例#3
0
 public static void Error(Util.Reflect.Info stackInfo, string text, params object[] args)
 {
     _Print(stackInfo, ConsoleColor.DarkRed, "Error", text, args);
     throw new Exception(string.Format(text, args));
 }
示例#4
0
 public static void Warn(Util.Reflect.Info stackInfo, string text, params object[] args)
 {
     _Print(stackInfo, ConsoleColor.DarkYellow, "Warn", text, args);
 }
示例#5
0
 public static void Debug(Util.Reflect.Info stackInfo, string text, params object[] args)
 {
     _Print(stackInfo, ConsoleColor.DarkGreen, "Debug", text, args);
 }
示例#6
0
 public static void Info(Util.Reflect.Info stackInfo, string text, params object[] args)
 {
     _Print(stackInfo, ConsoleColor.White, "Info", text, args);
 }