org.apache.slide.util.logger
Class SimpleLogger

java.lang.Object
  extended byorg.apache.slide.util.logger.SimpleLogger
All Implemented Interfaces:
Logger

public class SimpleLogger
extends java.lang.Object
implements Logger

Simple logger implementation.


Field Summary
protected  java.text.SimpleDateFormat dateFormat
          Date / Time format.
protected  int loggerLevel
          Logging level of the logger.
protected  java.lang.String[] loggingLevels
          Text values for logging priorities.
 
Fields inherited from interface org.apache.slide.util.logger.Logger
CRITICAL, DEBUG, DEFAULT_CHANNEL, EMERGENCY, ERROR, INFO, WARNING
 
Constructor Summary
SimpleLogger()
           
 
Method Summary
 int getLoggerLevel()
          Logger level getter.
 int getLoggerLevel(java.lang.String channel)
          Logger level getter.
 boolean isEnabled(int level)
          Check if the default channel with the specified level is enabled for logging.
 boolean isEnabled(java.lang.String channel, int level)
          Check if the channel with the specified level is enabled for logging.
 void log(java.lang.Object data)
          Log an object.
 void log(java.lang.Object data, int level)
          Log an object with the specified level.
 void log(java.lang.Object data, java.lang.String channel, int level)
          Log an object thru the specified channel and with the specified level.
 void log(java.lang.Object data, java.lang.Throwable throwable, java.lang.String channel, int level)
          Log an object and an associated throwable thru the specified channel and with the specified level.
 void setDateFormat(java.lang.String pattern)
          Date format setter.
 void setLoggerLevel(int loggerLevel)
          Logger level setter.
 void setLoggerLevel(java.lang.String channel, int loggerLevel)
          Logger level setter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loggerLevel

protected int loggerLevel
Logging level of the logger.


dateFormat

protected java.text.SimpleDateFormat dateFormat
Date / Time format.


loggingLevels

protected java.lang.String[] loggingLevels
Text values for logging priorities.

Constructor Detail

SimpleLogger

public SimpleLogger()
Method Detail

setLoggerLevel

public void setLoggerLevel(java.lang.String channel,
                           int loggerLevel)
Logger level setter.

Specified by:
setLoggerLevel in interface Logger
Parameters:
loggerLevel - New logger level
channel - The channel for which the level is set.

setLoggerLevel

public void setLoggerLevel(int loggerLevel)
Logger level setter.

Specified by:
setLoggerLevel in interface Logger
Parameters:
loggerLevel - New logger level

getLoggerLevel

public int getLoggerLevel()
Logger level getter.

Specified by:
getLoggerLevel in interface Logger
Returns:
int logger level

getLoggerLevel

public int getLoggerLevel(java.lang.String channel)
Logger level getter.

Specified by:
getLoggerLevel in interface Logger
Parameters:
channel - The channel whose log level is returned.
Returns:
int logger level

setDateFormat

public void setDateFormat(java.lang.String pattern)
Date format setter.

Parameters:
pattern - Format pattern

log

public void log(java.lang.Object data,
                java.lang.Throwable throwable,
                java.lang.String channel,
                int level)
Log an object and an associated throwable thru the specified channel and with the specified level.

Specified by:
log in interface Logger
Parameters:
data - object to log
throwable - throwable to be logged
channel - channel name used for logging
level - level used for logging

log

public void log(java.lang.Object data,
                java.lang.String channel,
                int level)
Log an object thru the specified channel and with the specified level.

Specified by:
log in interface Logger
Parameters:
data - The object to log.
channel - The channel name used for logging.
level - The level used for logging.

log

public void log(java.lang.Object data,
                int level)
Log an object with the specified level.

Specified by:
log in interface Logger
Parameters:
data - The object to log.
level - The level used for logging.

log

public void log(java.lang.Object data)
Log an object.

Specified by:
log in interface Logger
Parameters:
data - The object to log.

isEnabled

public boolean isEnabled(java.lang.String channel,
                         int level)
Check if the channel with the specified level is enabled for logging. This implementation ignores the channel specification

Specified by:
isEnabled in interface Logger
Parameters:
channel - The channel specification
level - The level specification

isEnabled

public boolean isEnabled(int level)
Check if the default channel with the specified level is enabled for logging.

Specified by:
isEnabled in interface Logger
Parameters:
level - The level specification