mosaic.sim.neuron
Class Debug

java.lang.Object
  |
  +--mosaic.sim.neuron.Debug

public class Debug
extends java.lang.Object

This class is used for debugging purposes, mainly for printing debug traces dependent on a trace level and for assertions (which will be supported natively in JDK 1.4 as soon as it becomes stable).


Field Summary
static boolean debug
          Debugging methods are enabled in the project only if this is set to true.
static int level
          Determines the debugging level, can be one of LEVEL_*.
static int LEVEL_ALL
          Log everything that can be logged.
static int LEVEL_CRITICAL
          Only log critical debug trace statements, this is minimal debugging.
static int LEVEL_ERROR
          Log everything from LEVEL_CRITICAL and error messages.
static int LEVEL_INFO
          Log everything from LEVEL_WARNING and info messages.
static int LEVEL_NONE
          Log nothing.
static int LEVEL_TRACE
          Log everything from LEVEL_INFO and print various traces for examining rhe program paths.
static int LEVEL_WARNING
          Log everything from LEVEL_ERROR and warning messages.
 
Constructor Summary
Debug()
           
 
Method Summary
static void assertCond(boolean condition, java.lang.String location, java.lang.String message)
          Assert that a condition is true.
static void output(int minlevel, java.lang.String message)
          Output some message if the currently set debugging level is equal to or higher than the given minimum debugging level.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

LEVEL_NONE

public static final int LEVEL_NONE
Log nothing.

LEVEL_CRITICAL

public static final int LEVEL_CRITICAL
Only log critical debug trace statements, this is minimal debugging.

LEVEL_ERROR

public static final int LEVEL_ERROR
Log everything from LEVEL_CRITICAL and error messages.

LEVEL_WARNING

public static final int LEVEL_WARNING
Log everything from LEVEL_ERROR and warning messages.

LEVEL_INFO

public static final int LEVEL_INFO
Log everything from LEVEL_WARNING and info messages.

LEVEL_TRACE

public static final int LEVEL_TRACE
Log everything from LEVEL_INFO and print various traces for examining rhe program paths.

LEVEL_ALL

public static final int LEVEL_ALL
Log everything that can be logged.

debug

public static final boolean debug
Debugging methods are enabled in the project only if this is set to true.

level

public static final int level
Determines the debugging level, can be one of LEVEL_*.
Constructor Detail

Debug

public Debug()
Method Detail

assertCond

public static void assertCond(boolean condition,
                              java.lang.String location,
                              java.lang.String message)
Assert that a condition is true.
Parameters:
condition - The assertion aborts program execution if condition is false.
location - This string should specify the exact program location from where the assertion is called.
message - This string is printed out in the debugging trace if the assertion fails.

output

public static void output(int minlevel,
                          java.lang.String message)
Output some message if the currently set debugging level is equal to or higher than the given minimum debugging level.
Parameters:
minlevel - The current debugging level must be equal to or higher than this value for the message to be printed.
message - The string that should be printed.