org.apache.fop.util

Class CommandLineLogger

Implemented Interfaces:
Log

public class CommandLineLogger
extends java.lang.Object
implements Log

This is a commons-logging logger for command line use.

Field Summary

static int
LOG_LEVEL_DEBUG
"Debug" level logging.
static int
LOG_LEVEL_ERROR
"Error" level logging.
static int
LOG_LEVEL_FATAL
"Fatal" level logging.
static int
LOG_LEVEL_INFO
"Info" level logging.
static int
LOG_LEVEL_TRACE
"Trace" level logging.
static int
LOG_LEVEL_WARN
"Warn" level logging.

Constructor Summary

CommandLineLogger(String logName)
Construct the logger with a default log level taken from the LogFactory attribute "level".

Method Summary

void
debug(Object message)
void
debug(Object message, Throwable t)
void
error(Object message)
void
error(Object message, Throwable t)
void
fatal(Object message)
void
fatal(Object message, Throwable t)
void
info(Object message)
void
info(Object message, Throwable t)
boolean
isDebugEnabled()
boolean
isErrorEnabled()
boolean
isFatalEnabled()
boolean
isInfoEnabled()
boolean
isTraceEnabled()
boolean
isWarnEnabled()
protected void
log(int type, Object message, Throwable t)
Do the actual logging.
void
setLogLevel(String level)
Set a log level for the logger.
void
trace(Object message)
void
trace(Object message, Throwable t)
void
warn(Object message)
void
warn(Object message, Throwable t)

Field Details

LOG_LEVEL_DEBUG

public static final int LOG_LEVEL_DEBUG
"Debug" level logging.
Field Value:
2

LOG_LEVEL_ERROR

public static final int LOG_LEVEL_ERROR
"Error" level logging.
Field Value:
5

LOG_LEVEL_FATAL

public static final int LOG_LEVEL_FATAL
"Fatal" level logging.
Field Value:
6

LOG_LEVEL_INFO

public static final int LOG_LEVEL_INFO
"Info" level logging.
Field Value:
3

LOG_LEVEL_TRACE

public static final int LOG_LEVEL_TRACE
"Trace" level logging.
Field Value:
1

LOG_LEVEL_WARN

public static final int LOG_LEVEL_WARN
"Warn" level logging.
Field Value:
4

Constructor Details

CommandLineLogger

public CommandLineLogger(String logName)
Construct the logger with a default log level taken from the LogFactory attribute "level".
Parameters:
logName - the logger name.

Method Details

debug

public final void debug(Object message)

debug

public final void debug(Object message,
                        Throwable t)

error

public final void error(Object message)

error

public final void error(Object message,
                        Throwable t)

fatal

public final void fatal(Object message)

fatal

public final void fatal(Object message,
                        Throwable t)

info

public final void info(Object message)

info

public final void info(Object message,
                       Throwable t)

isDebugEnabled

public final boolean isDebugEnabled()

isErrorEnabled

public final boolean isErrorEnabled()

isFatalEnabled

public final boolean isFatalEnabled()

isInfoEnabled

public final boolean isInfoEnabled()

isTraceEnabled

public final boolean isTraceEnabled()

isWarnEnabled

public final boolean isWarnEnabled()

log

protected void log(int type,
                   Object message,
                   Throwable t)
Do the actual logging. This method assembles the message and prints it to and then calls write() to cause it to be written.
Parameters:
type - One of the LOG_LEVEL_XXX constants defining the log level
message - The message itself (typically a String)
t - The exception whose stack trace should be logged

setLogLevel

public void setLogLevel(String level)
Set a log level for the logger.
Parameters:
level - the log level

trace

public final void trace(Object message)

trace

public final void trace(Object message,
                        Throwable t)

warn

public final void warn(Object message)

warn

public final void warn(Object message,
                       Throwable t)

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.