fop 0.95

org.apache.fop.util
Class CommandLineLogger

java.lang.Object
  extended by org.apache.fop.util.CommandLineLogger
All Implemented Interfaces:
org.apache.commons.logging.Log

public class CommandLineLogger
extends java.lang.Object
implements org.apache.commons.logging.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(java.lang.String logName)
          Construct the logger with a default log level taken from the LogFactory attribute "level".
 
Method Summary
 void debug(java.lang.Object message)
          
 void debug(java.lang.Object message, java.lang.Throwable t)
          
 void error(java.lang.Object message)
          
 void error(java.lang.Object message, java.lang.Throwable t)
          
 void fatal(java.lang.Object message)
          
 void fatal(java.lang.Object message, java.lang.Throwable t)
          
 void info(java.lang.Object message)
          
 void info(java.lang.Object message, java.lang.Throwable t)
          
 boolean isDebugEnabled()
          
 boolean isErrorEnabled()
          
 boolean isFatalEnabled()
          
 boolean isInfoEnabled()
          
 boolean isTraceEnabled()
          
 boolean isWarnEnabled()
          
protected  void log(int type, java.lang.Object message, java.lang.Throwable t)
          Do the actual logging.
 void setLogLevel(java.lang.String level)
          Set a log level for the logger.
 void trace(java.lang.Object message)
          
 void trace(java.lang.Object message, java.lang.Throwable t)
          
 void warn(java.lang.Object message)
          
 void warn(java.lang.Object message, java.lang.Throwable t)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_LEVEL_TRACE

public static final int LOG_LEVEL_TRACE
"Trace" level logging.

See Also:
Constant Field Values

LOG_LEVEL_DEBUG

public static final int LOG_LEVEL_DEBUG
"Debug" level logging.

See Also:
Constant Field Values

LOG_LEVEL_INFO

public static final int LOG_LEVEL_INFO
"Info" level logging.

See Also:
Constant Field Values

LOG_LEVEL_WARN

public static final int LOG_LEVEL_WARN
"Warn" level logging.

See Also:
Constant Field Values

LOG_LEVEL_ERROR

public static final int LOG_LEVEL_ERROR
"Error" level logging.

See Also:
Constant Field Values

LOG_LEVEL_FATAL

public static final int LOG_LEVEL_FATAL
"Fatal" level logging.

See Also:
Constant Field Values
Constructor Detail

CommandLineLogger

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

Parameters:
logName - the logger name.
Method Detail

setLogLevel

public void setLogLevel(java.lang.String level)
Set a log level for the logger.

Parameters:
level - the log level

isTraceEnabled

public final boolean isTraceEnabled()

Specified by:
isTraceEnabled in interface org.apache.commons.logging.Log

isDebugEnabled

public final boolean isDebugEnabled()

Specified by:
isDebugEnabled in interface org.apache.commons.logging.Log

isInfoEnabled

public final boolean isInfoEnabled()

Specified by:
isInfoEnabled in interface org.apache.commons.logging.Log

isWarnEnabled

public final boolean isWarnEnabled()

Specified by:
isWarnEnabled in interface org.apache.commons.logging.Log

isErrorEnabled

public final boolean isErrorEnabled()

Specified by:
isErrorEnabled in interface org.apache.commons.logging.Log

isFatalEnabled

public final boolean isFatalEnabled()

Specified by:
isFatalEnabled in interface org.apache.commons.logging.Log

trace

public final void trace(java.lang.Object message)

Specified by:
trace in interface org.apache.commons.logging.Log

trace

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

Specified by:
trace in interface org.apache.commons.logging.Log

debug

public final void debug(java.lang.Object message)

Specified by:
debug in interface org.apache.commons.logging.Log

debug

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

Specified by:
debug in interface org.apache.commons.logging.Log

info

public final void info(java.lang.Object message)

Specified by:
info in interface org.apache.commons.logging.Log

info

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

Specified by:
info in interface org.apache.commons.logging.Log

warn

public final void warn(java.lang.Object message)

Specified by:
warn in interface org.apache.commons.logging.Log

warn

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

Specified by:
warn in interface org.apache.commons.logging.Log

error

public final void error(java.lang.Object message)

Specified by:
error in interface org.apache.commons.logging.Log

error

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

Specified by:
error in interface org.apache.commons.logging.Log

fatal

public final void fatal(java.lang.Object message)

Specified by:
fatal in interface org.apache.commons.logging.Log

fatal

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

Specified by:
fatal in interface org.apache.commons.logging.Log

log

protected void log(int type,
                   java.lang.Object message,
                   java.lang.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

fop 0.95

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