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

Field Detail

TYPE

static final String TYPE
See Also:
Constant Field Values

NAME

static final String NAME
See Also:
Constant Field Values

CONFIG_INSTANCE

static final String CONFIG_INSTANCE
See Also:
Constant Field Values

TIME

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

setCategory

void setCategory(String category)
                 throws 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:
Exception

addAppender

void addAppender(LogConfigItem config,
                 Map params)
                 throws 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:
Exception

debug

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

Parameters:
str - The string to be logged

info

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

Parameters:
str - The string to be logged

warn

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

Parameters:
str - The string to be logged

error

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

Parameters:
str - The string to be logged

error

void error(String str,
           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(String str)
Log a message with level fatal.

Parameters:
str - The string to be logged

fatal

void fatal(String str,
           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(String level,
         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.