org.gxos.debug
Class Log

java.lang.Object
  |
  +--org.gxos.debug.Log

public class Log
extends java.lang.Object

Provides methods for debugging.

$Id: Log.java,v 1.8 2001/10/09 18:53:52 balsoy Exp $


Constructor Summary
Log()
           
 
Method Summary
static void debug(boolean d)
          Sets debug mode on or off.
static void debug(java.lang.Object obj, java.lang.String msg)
          Prints debug message along with an object.
static void debug(java.lang.String msg)
          Prints a debug message with a date preceding it.
static void error(java.lang.String err)
          Prints errors messages if used to the error output stream.
static java.io.Writer getDebugWriter()
          Returns the debug writer which is used by the logger.
static void msg(java.lang.String msg)
          Prints message to the log output.
static void setDebugWriter(java.io.Writer writer)
          Redirects debug messages to another output stream.
static void setErrorWriter(java.io.Writer writer)
          Redirects error messages to another output stream.
static void setMessageWriter(java.io.Writer writer)
          Redirects regular messages to another output stream.
 
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

setDebugWriter

public static void setDebugWriter(java.io.Writer writer)
Redirects debug messages to another output stream.
Parameters:
writer - an alternative writer object on which debug messages will be printed. If null, debug messages are stopped.

getDebugWriter

public static java.io.Writer getDebugWriter()
Returns the debug writer which is used by the logger.

Returns:
debug writer

setErrorWriter

public static void setErrorWriter(java.io.Writer writer)
Redirects error messages to another output stream.
Parameters:
writer - an alternative writer object on which error messages will be printed. If null, error messages are stopped.

setMessageWriter

public static void setMessageWriter(java.io.Writer writer)
Redirects regular messages to another output stream.
Parameters:
writer - an alternative writer object on which regular messages will be printed. If null, regular messages are stopped.

debug

public static void debug(boolean d)
Sets debug mode on or off.
Parameters:
d - Debug messages printed if true; otherwise no message sent to the log output stream.

debug

public static void debug(java.lang.String msg)
Prints a debug message with a date preceding it.
Parameters:
msg - Message to be printed.

debug

public static void debug(java.lang.Object obj,
                         java.lang.String msg)
Prints debug message along with an object. To provide more information about current state of the program or an object, this method can be used. Object is assumed providing a string method; otherwise it is printed with Object.toString() method.
Parameters:
obj - Object related to the message or context.
msg - Message to be printed.

error

public static void error(java.lang.String err)
Prints errors messages if used to the error output stream. Default is the standard output.
Parameters:
err - Error message to be printed.

msg

public static void msg(java.lang.String msg)
Prints message to the log output.
Parameters:
msg - Message to be printed.