home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / in4wjcxu / src / como / util / debug.java < prev    next >
Encoding:
Java Source  |  1996-08-14  |  481 b   |  32 lines

  1. /**
  2.  * Debug.java   Jan Kautz & Ulrich Gall
  3.  *
  4.  */
  5.  
  6. package como.util;
  7.  
  8. /*
  9.  * Used to display debug-messages.
  10.  */
  11.  
  12. public class Debug
  13. {
  14. static final int LEVEL = 0; // 0 = print all
  15.  
  16. public static void msg(int l,String s)
  17. {
  18.      if (l > LEVEL)
  19.         System.out.println("DEBUG("+l+"):"+s);
  20. }
  21.  
  22. public static void assert(boolean b)
  23. {
  24.      if (!b)
  25.         {
  26.         System.out.println("DEBUG: Assertion failed.");
  27.         Object o=null;
  28.         String s = o.toString();
  29.         }
  30. }
  31. }
  32.