public void output(DEBUG_LEVEL level, string msg, string endl = "\n") { if (level <= debug) { Console.Write(msg + endl); } }
/// <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; } }
private DebugFactory() { debugLevel = DEBUG_LEVEL.ERROR; }
public void Debug(string msg, DEBUG_LEVEL level = DEBUG_LEVEL.debug) { output(level, "Debug: " + msg); }
public void Verbose(string msg, DEBUG_LEVEL level = DEBUG_LEVEL.verbose) { output(level, "Verbose: " + msg); }
public void Error(string msg, DEBUG_LEVEL level = DEBUG_LEVEL.none) { output(level, "Error: " + msg); }
protected void debug(DEBUG_LEVEL level, string s) { DebugFactory.getInstance().debug(level, debugMode, s); }
/// <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; }
public static void add(DEBUG_LEVEL level, string message) { messageList.Add(new DebugMessage(level, message)); }