com.cafesoft.core.log
Class StderrLogger

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

public class StderrLogger
extends Object
implements Logger

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

Since:
4/10/02

Field Summary
static StderrLogger DEFAULT_STDERR_LOGGER
          Most objects create a StderrLogger 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 prop
          Configuration Properties.
 
Fields inherited from interface com.cafesoft.core.log.Logger
DEBUG, ERROR, FATAL, INFO, WARNING
 
Constructor Summary
StderrLogger()
          Create a new StderrLogger.
 
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 prop)
          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_STDERR_LOGGER

public static final StderrLogger DEFAULT_STDERR_LOGGER
Most objects create a StderrLogger 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 StderrLogger


prop

protected Properties prop
Configuration Properties.


messageFilter

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

Constructor Detail

StderrLogger

public StderrLogger()
Create a new StderrLogger.

Method Detail

initialize

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

Specified by:
initialize in interface Logger
Parameters:
prop - 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.