com.ibm.di.log
Interface LogInterface

All Known Implementing Classes:
LogListenerAdapter, TDIJLog, TDILog4j, TDILogJUL

public interface LogInterface

Defines an Interface to new Loggers. Any Logger we use must adhere to this interface. The Implementation must provide a public constructor with no arguments. After construction either the setCategory() or the addAppender() method will be called.


Field Summary
static java.lang.String CONFIG_INSTANCE
           
static java.lang.String NAME
           
static java.lang.String TIME
           
static java.lang.String TYPE
           
 
Method Summary
 void addAppender(LogConfigItem config, java.util.Map<java.lang.String,java.lang.Object> params)
          Add an Appender to the Logger using the given config.
 void close()
          Free up all resources this logger uses.
 void debug(java.lang.String str)
          Log a message with level debug.
 void error(java.lang.String str)
          Log a message with level error.
 void error(java.lang.String str, java.lang.Throwable error)
          Log a message with level error, and an additional Throwable.
 void fatal(java.lang.String str)
          Log a message with level fatal.
 void fatal(java.lang.String str, java.lang.Throwable error)
          Log a message with level fatal, and an additional Throwable.
 void info(java.lang.String str)
          Log a message with level info.
 boolean isDebugEnabled()
          Check if a debug message would be logged.
 void log(java.lang.String level, java.lang.String str)
          Log a message with the specified level.
 void setCategory(java.lang.String category)
          Set the category for this Logger.
 void warn(java.lang.String str)
          Log a message with level warning.
 

Field Detail

TYPE

static final java.lang.String TYPE
See Also:
Constant Field Values

NAME

static final java.lang.String NAME
See Also:
Constant Field Values

CONFIG_INSTANCE

static final java.lang.String CONFIG_INSTANCE
See Also:
Constant Field Values

TIME

static final java.lang.String TIME
See Also:
Constant Field Values
Method Detail

setCategory

void setCategory(java.lang.String category)
                 throws java.lang.Exception
Set the category for this Logger. This method specifies a category, to allow a category based configuration.

Parameters:
category - The category to use.
Throws:
java.lang.Exception

addAppender

void addAppender(LogConfigItem config,
                 java.util.Map<java.lang.String,java.lang.Object> params)
                 throws java.lang.Exception
Add an Appender to the Logger using the given config. Appender is the org.apache.log4j name, java.util.logging would call it a Handler. May throw an Exception if the config does not make sense.
The params Map may contain these keys to help set up the Appender:

Parameters:
config - The LogConfigItem.
params - Extra information that may be useful/
Throws:
java.lang.Exception

debug

void debug(java.lang.String str)
Log a message with level debug.

Parameters:
str - The string to be logged

info

void info(java.lang.String str)
Log a message with level info.

Parameters:
str - The string to be logged

warn

void warn(java.lang.String str)
Log a message with level warning.

Parameters:
str - The string to be logged

error

void error(java.lang.String str)
Log a message with level error.

Parameters:
str - The string to be logged

error

void error(java.lang.String str,
           java.lang.Throwable error)
Log a message with level error, and an additional Throwable.

Parameters:
str - The string to be logged
error - The Throwable to be logged

fatal

void fatal(java.lang.String str)
Log a message with level fatal.

Parameters:
str - The string to be logged

fatal

void fatal(java.lang.String str,
           java.lang.Throwable error)
Log a message with level fatal, and an additional Throwable.

Parameters:
str - The string to be logged
error - The Throwable to be logged

log

void log(java.lang.String level,
         java.lang.String str)
Log a message with the specified level.

Parameters:
level - The level to use when logging.
str - The string to be logged

isDebugEnabled

boolean isDebugEnabled()
Check if a debug message would be logged.

Returns:
true if a debug message might be logged

close

void close()
Free up all resources this logger uses. The logger will not be called anymore.