hades.models.mips.tools
Class Log

java.lang.Object
  extended byhades.models.mips.tools.Log

public class Log
extends java.lang.Object

Log to two different channels: log() and err(). Leaf methods can only use these methods, others have to call begin() and end() at this positions for correct spaces in front of the lines


Field Summary
static long cycleCounter
           
static char[] error
           
static boolean file
           
static int indent
           
static char[] leer
           
static boolean stdOut
           
 
Constructor Summary
Log()
           
 
Method Summary
static void begin(java.lang.String msg)
          If a method calls other methods with log output it should call begin() at the beginning and end() at the end.
static void end()
           
static void end(java.lang.String msg)
          If begin() has been used end() must be used, too, to indicate the end of a logical block (normally a method).
static void err(java.lang.String msg)
          Standard error output, output is done to StdErr and, if turned on, to the logfile.
static long getCycleCounter()
           
static boolean getFile()
           
static boolean getStdOut()
           
static void log(java.lang.String msg)
          Standard log output.
static void setCycleCounter(long newCycleCounter)
           
static void setFile(boolean newFile)
           
static void setStdOut(boolean newStdOut)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indent

public static int indent

leer

public static final char[] leer

error

public static final char[] error

stdOut

public static boolean stdOut

file

public static boolean file

cycleCounter

public static long cycleCounter
Constructor Detail

Log

public Log()
Method Detail

log

public static void log(java.lang.String msg)
Standard log output. The message should only contain the calling methods name if there is no Log.begin in this method. The output will be written to a file and to StdOut if setFile() and setStdOut() allow this. Only leaf methods should use log() without begin() and end().


err

public static void err(java.lang.String msg)
Standard error output, output is done to StdErr and, if turned on, to the logfile.


begin

public static void begin(java.lang.String msg)
If a method calls other methods with log output it should call begin() at the beginning and end() at the end. begin() without end() leads to big problems! begin() and end() are needed for a better structure of the log output. begin() always needs the name of the class and the method. Sometimes an additional instance name is needed.


end

public static void end(java.lang.String msg)
If begin() has been used end() must be used, too, to indicate the end of a logical block (normally a method). end() can be called with or without a message.


end

public static void end()

setStdOut

public static void setStdOut(boolean newStdOut)

getStdOut

public static boolean getStdOut()

setFile

public static void setFile(boolean newFile)

getFile

public static boolean getFile()

setCycleCounter

public static void setCycleCounter(long newCycleCounter)

getCycleCounter

public static long getCycleCounter()