org.psychomad.psycholib.log
Class Log

java.lang.Object
  extended by org.psychomad.psycholib.log.Log

public class Log
extends java.lang.Object

This class provides several methods to log messages. Particulary it enable, after giving a correct filename, to write debug message in a file.


Constructor Summary
Log()
           
 
Method Summary
static void deb(java.lang.Object msg)
          This method allow to write to the stderr (or to a file if one available) the object pass in arg ONLY if the debug mode is activated.
static void err(java.lang.Object msg)
          This method allow to write to the stderr the object pass in arg.
static boolean isDebugModeEnabled()
          Allow to know if the debug mode is active.
static void out(java.lang.Object msg)
          This method allow to write to the stdout the object pass in arg.
static void setDebFilename(java.lang.String filename)
          This method allow to use a file that get the debug output.
static void setDebugModeEnabled(boolean newDebugMode)
          Allow to set the debug mode on or off.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log

public Log()
Method Detail

out

public static void out(java.lang.Object msg)
This method allow to write to the stdout the object pass in arg. This print is follow by a newline character.

Parameters:
msg - the object to write

err

public static void err(java.lang.Object msg)
This method allow to write to the stderr the object pass in arg. This print is follow by a newline character.

Parameters:
msg - the object to write

setDebugModeEnabled

public static void setDebugModeEnabled(boolean newDebugMode)
Allow to set the debug mode on or off.

Parameters:
newDebugMode - the new debug mode. True activate the debug mode and false desactivate it.

isDebugModeEnabled

public static boolean isDebugModeEnabled()
Allow to know if the debug mode is active.

Returns:
true if debug mode is active, false otherwise.

deb

public static void deb(java.lang.Object msg)
This method allow to write to the stderr (or to a file if one available) the object pass in arg ONLY if the debug mode is activated. This print (if effective) is follow by a newline character. If a filename is used the method open the file in write mode, if it is impossible (security restriction...) it throws an exception.

Parameters:
msg - the object to write
See Also:
setDebugModeEnabled(boolean), setDebFilename(java.lang.String)

setDebFilename

public static void setDebFilename(java.lang.String filename)
This method allow to use a file that get the debug output.

Parameters:
filename - the name of the file that will be used for deb log


Copyright 2006 null. All Rights Reserved.