com.monkeycoder.monkeynes.base
Class DebugLog

java.lang.Object
  |
  +--com.monkeycoder.monkeynes.base.DebugLog

public class DebugLog
extends Object

This class is a logger singleton that can direct log output to several places.

Originally part of the MonkeyNES project.

Author:
David Stephens

Field Summary
static int MODE_FILE
           
static int MODE_NULL
           
static int MODE_STD_ERR
           
static int MODE_STD_OUT
           
 
Method Summary
static DebugLog getInst()
          Returns the only allowed instance of this class.
static int getMode()
          Returns the current redirection mode.
static int getVerbosity()
          Returns the current verbosity threshhold.
static void log(int inVerbosity, String inText)
          Records a log entry using the provided verbosity threshhold value.
static void log(String inText)
          Records a log entry using the maximum verbosity threshhold of 5.
static void restoreLastMode()
          Puts the DebugLog back into its previous redirection mode.
static void restoreLastVerbosity()
          Puts the DebugLog back into its previous verbosity threshhold.
static void setMode(int inMode)
          Sets the current redirection mode.
static void setVerbosity(int inVThresh)
          Sets the current verbosity threshhold.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_NULL

public static final int MODE_NULL
See Also:
Constant Field Values

MODE_STD_OUT

public static final int MODE_STD_OUT
See Also:
Constant Field Values

MODE_STD_ERR

public static final int MODE_STD_ERR
See Also:
Constant Field Values

MODE_FILE

public static final int MODE_FILE
See Also:
Constant Field Values
Method Detail

getInst

public static DebugLog getInst()
Returns the only allowed instance of this class.

Returns:
The DebogLog instance.

log

public static void log(String inText)
Records a log entry using the maximum verbosity threshhold of 5.

Parameters:
inText - The text for the log entry.

log

public static void log(int inVerbosity,
                       String inText)
Records a log entry using the provided verbosity threshhold value.

Parameters:
inVerbosity - The verbosity threshhold required to see this log entry.
inText - The text for the log entry.

setMode

public static void setMode(int inMode)
Sets the current redirection mode.

Parameters:
inMode - The redirection mode to which the DebugLog will be set.

getMode

public static int getMode()
Returns the current redirection mode.

Returns:
The redirection mode.

restoreLastMode

public static void restoreLastMode()
Puts the DebugLog back into its previous redirection mode.


setVerbosity

public static void setVerbosity(int inVThresh)
Sets the current verbosity threshhold.

Parameters:
inVThresh - The verbosity threshhold to which the DebugLog will be set.

getVerbosity

public static int getVerbosity()
Returns the current verbosity threshhold.

Returns:
The verbosity threshhold.

restoreLastVerbosity

public static void restoreLastVerbosity()
Puts the DebugLog back into its previous verbosity threshhold.