com.cafesoft.core.log
Class StdoutLogger

java.lang.Object
  |
  +--com.cafesoft.core.log.StdoutLogger
All Implemented Interfaces:
Logger

public class StdoutLogger
extends Object
implements Logger

Logs message to the System.out OutputStream. By default, the "MessageLevelMessageFilter" is installed and used with all message levels enabled.

Since:
4/10/02

Field Summary
static StdoutLogger DEFAULT_STDOUT_LOGGER
          Most objects create a StdoutLogger object as there default logger as to avoid NullPointerExceptions when attempting to log information However, the end result is that each object create's it's own logger that is basically the same accross the board.
protected  MessageFilter messageFilter
          The MessageFilter used to discriminate messages to be logged.
protected  Properties properties
          Configuration Properties.
protected  boolean verbose
          Boolean flag that indicates if the logger is printing verbose information such as the class name
 
Fields inherited from interface com.cafesoft.core.log.Logger
DEBUG, ERROR, FATAL, INFO, WARNING
 
Constructor Summary
StdoutLogger()
          Create a new StdoutLogger.
 
Method Summary
 void debug(Object source, String message)
          Log a debug message from the specified source object.
 void debug(Object source, String message, Throwable throwable)
          Log a debug message from the specified source object.
 void error(Object source, String message)
          Log a error message from the specified source object.
 void error(Object source, String message, Throwable throwable)
          Log a error message from the specified source object.
 void fatal(Object source, String message)
          Log a fatal message from the specified source object.
 void fatal(Object source, String message, Throwable throwable)
          Log a fatal message from the specified source object.
 void info(Object source, String message)
          Log an info message from the specified source object.
 void info(Object source, String message, Throwable throwable)
          Log an info message from the specified source object.
 void initialize(Properties properties)
          Initialize the Logger.
 void setMessageFilter(MessageFilter messageFilter)
          Set a message filter.
 void warning(Object source, String message)
          Log a warning message from the specified source object.
 void warning(Object source, String message, Throwable throwable)
          Log a warning message from the specified source object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_STDOUT_LOGGER

public static final StdoutLogger DEFAULT_STDOUT_LOGGER
Most objects create a StdoutLogger object as there default logger as to avoid NullPointerExceptions when attempting to log information However, the end result is that each object create's it's own logger that is basically the same accross the board. This logger is the single instance that all objects should be initialized with. However, this is not a Singleton design as it is completely possible to have and need several unique instances of a StdoutLogger.


properties

protected Properties properties
Configuration Properties.


verbose

protected boolean verbose
Boolean flag that indicates if the logger is printing verbose information such as the class name


messageFilter

protected MessageFilter messageFilter
The MessageFilter used to discriminate messages to be logged.

Constructor Detail

StdoutLogger

public StdoutLogger()
Create a new StdoutLogger.

Method Detail

initialize

public void initialize(Properties properties)
                throws LoggerException
Initialize the Logger.

Specified by:
initialize in interface Logger
Parameters:
properties - initialization Properties
Throws:
LoggerException - if an error initializing the Logger

setMessageFilter

public void setMessageFilter(MessageFilter messageFilter)
Set a message filter.

Specified by:
setMessageFilter in interface Logger
Parameters:
messageFilter - the MessageFilter that discriminates the messages to be logged

debug

public void debug(Object source,
                  String message)
Log a debug message from the specified source object.

Specified by:
debug in interface Logger
Parameters:
source - the source of the message
message - the debug message to be logged

debug

public void debug(Object source,
                  String message,
                  Throwable throwable)
Log a debug message from the specified source object.

Specified by:
debug in interface Logger
Parameters:
source - the source of the message
message - the debug message to be logged
throwable - an Exception or Error to be logged

info

public void info(Object source,
                 String message)
Log an info message from the specified source object.

Specified by:
info in interface Logger
Parameters:
source - the source of the message
message - the info message to be logged

info

public void info(Object source,
                 String message,
                 Throwable throwable)
Log an info message from the specified source object.

Specified by:
info in interface Logger
Parameters:
source - the source of the message
message - the info message to be logged
throwable - an Exception or Error to be logged

warning

public void warning(Object source,
                    String message)
Log a warning message from the specified source object.

Specified by:
warning in interface Logger
Parameters:
source - the source of the message
message - the info message to be logged

warning

public void warning(Object source,
                    String message,
                    Throwable throwable)
Log a warning message from the specified source object.

Specified by:
warning in interface Logger
Parameters:
source - the source of the message
message - the warning message to be logged
throwable - an Exception or Error to be logged

error

public void error(Object source,
                  String message)
Log a error message from the specified source object.

Specified by:
error in interface Logger
Parameters:
source - the source of the message
message - the info message to be logged

error

public void error(Object source,
                  String message,
                  Throwable throwable)
Log a error message from the specified source object.

Specified by:
error in interface Logger
Parameters:
source - the source of the message
message - the error message to be logged
throwable - an Exception or Error to be logged

fatal

public void fatal(Object source,
                  String message)
Log a fatal message from the specified source object.

Specified by:
fatal in interface Logger
Parameters:
source - the source of the message
message - the info message to be logged

fatal

public void fatal(Object source,
                  String message,
                  Throwable throwable)
Log a fatal message from the specified source object.

Specified by:
fatal in interface Logger
Parameters:
source - the source of the message
message - the fatal message to be logged
throwable - an Exception or Error to be logged


Generated on 5:16:42 PM May 12, 2008, © 1996-2005 Cafésoft LLC. All rights reserved.