org.apache.ojb.broker.util.logging
Class PoorMansLoggerImpl

java.lang.Object
  extended by org.apache.ojb.broker.util.logging.PoorMansLoggerImpl
All Implemented Interfaces:
java.io.Serializable, org.apache.ojb.broker.util.configuration.Configurable, Logger
Direct Known Subclasses:
StringBufferLoggerImpl

public class PoorMansLoggerImpl
extends java.lang.Object
implements Logger

this is a most simple Logger implementation. All output is directed to System.out.

Version:
$Id: PoorMansLoggerImpl.java 365263 2005-12-31 18:39:00Z arminw $
Author:
Thomas Mahler
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.ojb.broker.util.logging.Logger
DEBUG, ERROR, FATAL, INFO, serialVersionUID, WARN
 
Constructor Summary
PoorMansLoggerImpl(java.lang.String name)
           
 
Method Summary
 void configure(org.apache.ojb.broker.util.configuration.Configuration config)
          configure an object using the Configuration pConfig
 void debug(java.lang.Object pObject)
          generate a message for loglevel DEBUG
 void debug(java.lang.Object message, java.lang.Throwable t)
           
 void error(java.lang.Object pObject)
          generate a message for loglevel ERROR
 void error(java.lang.Object message, java.lang.Throwable t)
           
 void fatal(java.lang.Object pObject)
          generate a message for loglevel FATAL
 void fatal(java.lang.Object message, java.lang.Throwable t)
           
 java.lang.String getName()
          returns the name of the logger isntance
 void info(java.lang.Object pObject)
          generate a message for loglevel INFO
 void info(java.lang.Object message, java.lang.Throwable t)
           
 boolean isDebugEnabled()
           
 boolean isEnabledFor(int priority)
           
 void safeDebug(java.lang.String message, java.lang.Object obj)
          Exception safe log method.
 void safeDebug(java.lang.String message, java.lang.Object obj, java.lang.Throwable t)
          Exception safe log method.
 void safeError(java.lang.String message, java.lang.Object obj)
          Exception safe log method.
 void safeError(java.lang.String message, java.lang.Object obj, java.lang.Throwable t)
          Exception safe log method.
 void safeFatal(java.lang.String message, java.lang.Object obj)
          Exception safe log method.
 void safeFatal(java.lang.String message, java.lang.Object obj, java.lang.Throwable t)
          Exception safe log method.
 void safeInfo(java.lang.String message, java.lang.Object obj)
          Exception safe log method.
 void safeInfo(java.lang.String message, java.lang.Object obj, java.lang.Throwable t)
          Exception safe log method.
 void safeWarn(java.lang.String message, java.lang.Object obj)
          Exception safe log method.
 void safeWarn(java.lang.String message, java.lang.Object obj, java.lang.Throwable t)
          Exception safe log method.
 void setLevel(java.lang.String levelName)
           
 void warn(java.lang.Object pObject)
          generate a message for loglevel WARN
 void warn(java.lang.Object message, java.lang.Throwable t)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PoorMansLoggerImpl

public PoorMansLoggerImpl(java.lang.String name)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: Logger
returns the name of the logger isntance

Specified by:
getName in interface Logger

debug

public void debug(java.lang.Object pObject)
generate a message for loglevel DEBUG

Specified by:
debug in interface Logger
Parameters:
pObject - the message Object

debug

public void debug(java.lang.Object message,
                  java.lang.Throwable t)
Specified by:
debug in interface Logger

safeDebug

public void safeDebug(java.lang.String message,
                      java.lang.Object obj)
Description copied from interface: Logger
Exception safe log method. This method can be used to prevent any exception thrown by obj.toString() implementations. Log level used : DEBUG

Specified by:
safeDebug in interface Logger

safeDebug

public void safeDebug(java.lang.String message,
                      java.lang.Object obj,
                      java.lang.Throwable t)
Description copied from interface: Logger
Exception safe log method. This method can be used to prevent any exception thrown by obj.toString() implementations. Log level used : DEBUG

Specified by:
safeDebug in interface Logger

info

public void info(java.lang.Object pObject)
generate a message for loglevel INFO

Specified by:
info in interface Logger
Parameters:
pObject - the message Object

info

public void info(java.lang.Object message,
                 java.lang.Throwable t)
Specified by:
info in interface Logger

safeInfo

public void safeInfo(java.lang.String message,
                     java.lang.Object obj)
Description copied from interface: Logger
Exception safe log method. This method can be used to prevent any exception thrown by obj.toString() implementations. Log level used : INFO

Specified by:
safeInfo in interface Logger

safeInfo

public void safeInfo(java.lang.String message,
                     java.lang.Object obj,
                     java.lang.Throwable t)
Description copied from interface: Logger
Exception safe log method. This method can be used to prevent any exception thrown by obj.toString() implementations. Log level used : INFO

Specified by:
safeInfo in interface Logger

warn

public void warn(java.lang.Object pObject)
generate a message for loglevel WARN

Specified by:
warn in interface Logger
Parameters:
pObject - the message Object

warn

public void warn(java.lang.Object message,
                 java.lang.Throwable t)
Specified by:
warn in interface Logger

safeWarn

public void safeWarn(java.lang.String message,
                     java.lang.Object obj)
Description copied from interface: Logger
Exception safe log method. This method can be used to prevent any exception thrown by obj.toString() implementations. Log level used : WARN

Specified by:
safeWarn in interface Logger

safeWarn

public void safeWarn(java.lang.String message,
                     java.lang.Object obj,
                     java.lang.Throwable t)
Description copied from interface: Logger
Exception safe log method. This method can be used to prevent any exception thrown by obj.toString() implementations. Log level used : WARN

Specified by:
safeWarn in interface Logger

error

public void error(java.lang.Object pObject)
generate a message for loglevel ERROR

Specified by:
error in interface Logger
Parameters:
pObject - the message Object

error

public void error(java.lang.Object message,
                  java.lang.Throwable t)
Specified by:
error in interface Logger

safeError

public void safeError(java.lang.String message,
                      java.lang.Object obj)
Description copied from interface: Logger
Exception safe log method. This method can be used to prevent any exception thrown by obj.toString() implementations. Log level used : ERROR

Specified by:
safeError in interface Logger

safeError

public void safeError(java.lang.String message,
                      java.lang.Object obj,
                      java.lang.Throwable t)
Description copied from interface: Logger
Exception safe log method. This method can be used to prevent any exception thrown by obj.toString() implementations. Log level used : ERROR

Specified by:
safeError in interface Logger

fatal

public void fatal(java.lang.Object pObject)
generate a message for loglevel FATAL

Specified by:
fatal in interface Logger
Parameters:
pObject - the message Object

fatal

public void fatal(java.lang.Object message,
                  java.lang.Throwable t)
Specified by:
fatal in interface Logger

safeFatal

public void safeFatal(java.lang.String message,
                      java.lang.Object obj)
Description copied from interface: Logger
Exception safe log method. This method can be used to prevent any exception thrown by obj.toString() implementations. Log level used : FATAL

Specified by:
safeFatal in interface Logger

safeFatal

public void safeFatal(java.lang.String message,
                      java.lang.Object obj,
                      java.lang.Throwable t)
Description copied from interface: Logger
Exception safe log method. This method can be used to prevent any exception thrown by obj.toString() implementations. Log level used : FATAL

Specified by:
safeFatal in interface Logger

isDebugEnabled

public boolean isDebugEnabled()
Specified by:
isDebugEnabled in interface Logger

isEnabledFor

public boolean isEnabledFor(int priority)
Specified by:
isEnabledFor in interface Logger

configure

public void configure(org.apache.ojb.broker.util.configuration.Configuration config)
               throws org.apache.ojb.broker.util.configuration.ConfigurationException
Description copied from interface: org.apache.ojb.broker.util.configuration.Configurable
configure an object using the Configuration pConfig

Specified by:
configure in interface org.apache.ojb.broker.util.configuration.Configurable
Specified by:
configure in interface Logger
Parameters:
config - the Configuration object used to configure current instance
Throws:
org.apache.ojb.broker.util.configuration.ConfigurationException

setLevel

public void setLevel(java.lang.String levelName)


(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30