mako5.util
Class Log

java.lang.Object
  extended by mako5.util.Log

public final class Log
extends Object

Goals

The need for a global logging system was seen. The output can be redirected to multiple locations given the type of message required. At the same time all messages can be sent to the same source if desired and setup properly.

Risks and Payoffs

System.out.println(...) will no longer be used as a result, and the logs will be able to be used for End-user problem identification if needed.

Since:
09-Apr 2006
Version:
09-Apr 2006, 29-Apr 2006, 29-Jul 2006
Author:
Paul Jarrett

Field Summary
static int DEBUG
          Bit flag used to indicate something pertaining to a debug-only message.
static int ERROR
          Bit flag used to indicate something pertaining to an error message.
static int OUT
          Bit flag used to indicate something pertaining to an output message.
 
Method Summary
static void disable(int targets_)
          Disable streams that will print messages.
static void enable(int targets_)
          Enables streams that will print messages.
static void println(String message_, int targets_)
          Prints something to the given streams.
static void setStream(PrintStream stream_, int flags_)
          Sets the requested streams.
static void setTrace(int targets_)
          Sets the streams that will be traced.
static void stackTrace(int targets_)
          Prints a stack trace to the requested targets.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR

public static final int ERROR
Bit flag used to indicate something pertaining to an error message.

Since:
29-Jul 2006
See Also:
Constant Field Values

OUT

public static final int OUT
Bit flag used to indicate something pertaining to an output message.

Since:
29-Jul 2006
See Also:
Constant Field Values

DEBUG

public static final int DEBUG
Bit flag used to indicate something pertaining to a debug-only message.

Since:
29-Jul 2006
See Also:
Constant Field Values
Method Detail

setStream

public static void setStream(PrintStream stream_,
                             int flags_)
Sets the requested streams. A stream is given, along with flags for which streams to set. This permits the setting of multiple streams with a single command.

Parameters:
stream_ - the new stream_
flags_ - the streams to set
Since:
29-Apr 2006

stackTrace

public static void stackTrace(int targets_)
Prints a stack trace to the requested targets.

Parameters:
targets_ - the flags for requested streams
Since:
29-Apr 2006, 29-Jul 2006

println

public static void println(String message_,
                           int targets_)
Prints something to the given streams.

Parameters:
message_ - what to print
targets_ - the target stream(s)
Since:
29-Jul 2006

enable

public static void enable(int targets_)
Enables streams that will print messages.

Parameters:
targets_ - the flags for requested streams
Since:
29-Jul 2006

disable

public static void disable(int targets_)
Disable streams that will print messages.

Parameters:
targets_ - the flags for requested streams
Since:
29-Jul 2006

setTrace

public static void setTrace(int targets_)
Sets the streams that will be traced. Overwrites previous settings.

Parameters:
targets_ - the streams that should be traced
Since:
29-Jul 2006