Beispiel #1
0
 public void output(DEBUG_LEVEL level, string msg, string endl = "\n")
 {
     if (level <= debug)
     {
         Console.Write(msg + endl);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Debugs the specified level.
        /// </summary>
        /// <param name="level">The level.</param>
        /// <param name="dMode">The d mode.</param>
        /// <param name="dString">The d string.</param>
        public void debug(DEBUG_LEVEL level, DEBUG_MODE dMode, string dString)
        {
            if (level != debugLevel && debugLevel != DEBUG_LEVEL.ALL)
            {
                // return;
            }

            switch (dMode)
            {
            default:
            case DEBUG_MODE.DISABLED:
                break;

            case DEBUG_MODE.CONSOLE:
                System.Console.WriteLine(dString);
                break;

            case DEBUG_MODE.FILE:
                writeIntoFile(dString);
                break;
            }
        }
Beispiel #3
0
 private DebugFactory()
 {
     debugLevel = DEBUG_LEVEL.ERROR;
 }
Beispiel #4
0
 public void Debug(string msg, DEBUG_LEVEL level = DEBUG_LEVEL.debug)
 {
     output(level, "Debug: " + msg);
 }
Beispiel #5
0
 public void Verbose(string msg, DEBUG_LEVEL level = DEBUG_LEVEL.verbose)
 {
     output(level, "Verbose: " + msg);
 }
Beispiel #6
0
 public void Error(string msg, DEBUG_LEVEL level = DEBUG_LEVEL.none)
 {
     output(level, "Error: " + msg);
 }
Beispiel #7
0
 protected void debug(DEBUG_LEVEL level, string s)
 {
     DebugFactory.getInstance().debug(level, debugMode, s);
 }
Beispiel #8
0
 /// <summary>
 /// Debugs the specified level.
 /// </summary>
 /// <param name="level">The level.</param>
 /// <param name="dString">The d string.</param>
 private void debug(DEBUG_LEVEL level, string dString)
 {
     DebugFactory.getInstance().debug(level, debugMode, dString);
 }
 public DebugMessage(DEBUG_LEVEL level, string message)
 {
     this.time    = DateTime.Now;
     this.level   = level;
     this.message = message;
 }
Beispiel #10
0
 public static void add(DEBUG_LEVEL level, string message)
 {
     messageList.Add(new DebugMessage(level, message));
 }