com.dallaway.sloppy
Class Log

java.lang.Object
  |
  +--com.dallaway.sloppy.Log

public class Log
extends java.lang.Object

Utility for logging events, errors and debugging information.

This version simply writes to STDOUT and STDERR

End user events are date stamped. Notices, errors and debugging lines start with a hash (#).


Field Summary
protected  boolean DEBUG
           
 
Constructor Summary
Log()
          Construct a new default log
 
Method Summary
 void debug(java.lang.String msg)
          Write a debugging message
 void error(java.lang.Exception ex)
          Record an error event
 void error(java.lang.String msg)
          Record an error
 void error(java.lang.String msg, java.lang.Exception ex)
          Record an error
 void event(java.lang.String client, java.lang.String msg)
          Record an event, such as a client request, which should be logged for the end user
 void notice(java.lang.String msg)
          Record a notice event, such as service startup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

protected final boolean DEBUG
Constructor Detail

Log

public Log()
Construct a new default log
Method Detail

event

public void event(java.lang.String client,
                  java.lang.String msg)
Record an event, such as a client request, which should be logged for the end user
Parameters:
client_id - A string identifying the client
message - The message to log. A time stamp will be included in the output

debug

public void debug(java.lang.String msg)
Write a debugging message
Parameters:
message - The message to write

notice

public void notice(java.lang.String msg)
Record a notice event, such as service startup
Parameters:
message - The message to write

error

public void error(java.lang.String msg)
Record an error
Parameters:
message - The message to record

error

public void error(java.lang.String msg,
                  java.lang.Exception ex)
Record an error
Parameters:
message - The message to write
exception - Associated exception

error

public void error(java.lang.Exception ex)
Record an error event
Parameters:
exception - Associated exception