de.betabeans.scroogexhtml.logging
Class Logger

java.lang.Object
  extended by de.betabeans.scroogexhtml.logging.Logger
All Implemented Interfaces:
Log
Direct Known Subclasses:
DefaultLogger

public class Logger
extends java.lang.Object
implements Log

Simple implementation of the Log Interface with 'empty' logging methods. If you need a Logger which creates output, use Logger.setLogger(new DefaultLogger()); Note: you can use the logging system Log4J if you replace the import statements for the logging package by import org.apache.log4j.Logger;. For more details, please read the documentation for the logging package.

See Also:
de.betabeans.scroogexhtml.logging

Constructor Summary
protected Logger()
          Protected constructor that is not available for public use.
 
Method Summary
static void addLogListener(LogListener listener)
          Add a log listener.
 void debug(java.lang.Object message)
          Empty implementation
 void debug(java.lang.Object message, java.lang.Throwable t)
          Empty implementation.
 void error(java.lang.Object message)
          Empty implementation
 void error(java.lang.Object message, java.lang.Throwable t)
          Empty implementation.
 void fatal(java.lang.Object message)
          Empty implementation.
 void fatal(java.lang.Object message, java.lang.Throwable t)
          Empty implementation.
static Logger getLogger(java.lang.Class clazz)
          Get the logger object.
static short getLogLevel()
          Get the logging level.
static LogListener[] getLogListeners()
          The get<ListenerType>s method returns the set of registered event listeners.
static java.util.Vector getLogListenerVector()
          Returns the log listener vector value.
 void info(java.lang.Object message)
          Empty implementation
 void info(java.lang.Object message, java.lang.Throwable t)
          Empty implementation.
 boolean isDebugEnabled()
           Is debug logging currently enabled?
 boolean isErrorEnabled()
           Is error logging currently enabled?
 boolean isFatalEnabled()
           Is fatal logging currently enabled?
 boolean isInfoEnabled()
           Is info logging currently enabled?
 boolean isTraceEnabled()
           Is trace logging currently enabled?
 boolean isWarnEnabled()
           Is warn logging currently enabled?
static void removeLogListener(LogListener listener)
          Remove a LogListener.
static void setLogger(Logger newValue)
          Set the logger object.
static void setLogLevel(short newValue)
          Set the logging level.
 void trace(java.lang.Object message)
           Log a message with trace log level.
 void trace(java.lang.Object message, java.lang.Throwable t)
          Empty implementation.
 void warn(java.lang.Object message)
          Empty implementation
 void warn(java.lang.Object message, java.lang.Throwable t)
          Empty implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Logger

protected Logger()
Protected constructor that is not available for public use.

Method Detail

setLogger

public static void setLogger(Logger newValue)
Set the logger object.

Parameters:
newValue - Logger

getLogger

public static Logger getLogger(java.lang.Class clazz)
Get the logger object.

Parameters:
clazz - Class
Returns:
Logger

getLogLevel

public static short getLogLevel()
Get the logging level.

Returns:
short

setLogLevel

public static void setLogLevel(short newValue)
Set the logging level.

Parameters:
newValue - short

getLogListenerVector

public static java.util.Vector getLogListenerVector()
Returns the log listener vector value.

Returns:
The logListeners value

getLogListeners

public static LogListener[] getLogListeners()
The get<ListenerType>s method returns the set of registered event listeners. This method is recommended in the amendment to the JavaBeans Specification, last Revision Oct 3, 2000.

Returns:
The logListeners array
See Also:
Getting Listeners from JavaBeans

addLogListener

public static void addLogListener(LogListener listener)
Add a log listener. If You write an event handler for the beans 'log' event, the event handler will be added to the list of log listeners.

Parameters:
listener - The feature to be added to the LogListener attribute

removeLogListener

public static void removeLogListener(LogListener listener)
Remove a LogListener.

Parameters:
listener - The logging listener.

isDebugEnabled

public boolean isDebugEnabled()

Is debug logging currently enabled?

Call this method to prevent having to perform expensive operations (for example, String concatenation) when the log level is more than debug.

Specified by:
isDebugEnabled in interface Log
Returns:
boolean

isErrorEnabled

public boolean isErrorEnabled()

Is error logging currently enabled?

Call this method to prevent having to perform expensive operations (for example, String concatenation) when the log level is more than error.

Specified by:
isErrorEnabled in interface Log
Returns:
boolean

isFatalEnabled

public boolean isFatalEnabled()

Is fatal logging currently enabled?

Call this method to prevent having to perform expensive operations (for example, String concatenation) when the log level is more than fatal.

Specified by:
isFatalEnabled in interface Log
Returns:
boolean

isInfoEnabled

public boolean isInfoEnabled()

Is info logging currently enabled?

Call this method to prevent having to perform expensive operations (for example, String concatenation) when the log level is more than info.

Specified by:
isInfoEnabled in interface Log
Returns:
boolean

isTraceEnabled

public boolean isTraceEnabled()

Is trace logging currently enabled?

Call this method to prevent having to perform expensive operations (for example, String concatenation) when the log level is more than trace.

Specified by:
isTraceEnabled in interface Log
Returns:
boolean

isWarnEnabled

public boolean isWarnEnabled()

Is warn logging currently enabled?

Call this method to prevent having to perform expensive operations (for example, String concatenation) when the log level is more than warn.

Specified by:
isWarnEnabled in interface Log
Returns:
boolean

trace

public void trace(java.lang.Object message)

Log a message with trace log level.

Specified by:
trace in interface Log
Parameters:
message - log this message

debug

public void debug(java.lang.Object message)
Empty implementation

Specified by:
debug in interface Log
Parameters:
message - The message to be logged.

info

public void info(java.lang.Object message)
Empty implementation

Specified by:
info in interface Log
Parameters:
message - The message to be logged.

warn

public void warn(java.lang.Object message)
Empty implementation

Specified by:
warn in interface Log
Parameters:
message - The message to be logged.

error

public void error(java.lang.Object message)
Empty implementation

Specified by:
error in interface Log
Parameters:
message - The message to be logged.

fatal

public void fatal(java.lang.Object message)
Empty implementation.

Specified by:
fatal in interface Log
Parameters:
message - The message to be logged.

trace

public void trace(java.lang.Object message,
                  java.lang.Throwable t)
Empty implementation.

Specified by:
trace in interface Log
Parameters:
message - Object
t - Throwable

debug

public void debug(java.lang.Object message,
                  java.lang.Throwable t)
Empty implementation.

Specified by:
debug in interface Log
Parameters:
message - Object
t - Throwable

info

public void info(java.lang.Object message,
                 java.lang.Throwable t)
Empty implementation.

Specified by:
info in interface Log
Parameters:
message - Object
t - Throwable

warn

public void warn(java.lang.Object message,
                 java.lang.Throwable t)
Empty implementation.

Specified by:
warn in interface Log
Parameters:
message - Object
t - Throwable

error

public void error(java.lang.Object message,
                  java.lang.Throwable t)
Empty implementation.

Specified by:
error in interface Log
Parameters:
message - Object
t - Throwable

fatal

public void fatal(java.lang.Object message,
                  java.lang.Throwable t)
Empty implementation.

Specified by:
fatal in interface Log
Parameters:
message - Object
t - Throwable


Copyright (c) 1998-2006 BetaSoft Michael Justin. All Rights Reserved.