org.apache.velocity.runtime.log
Class LogDisplayWrapper

java.lang.Object
  extended by org.apache.velocity.runtime.log.Log
      extended by org.apache.velocity.runtime.log.LogDisplayWrapper

public class LogDisplayWrapper
extends Log

This is a wrapper around a log object, that can add a prefix to log messages and also turn logging on and off dynamically. It is mainly used to control the logging of VelociMacro generation messages but is actually generic enough code.

Since:
1.5
Version:
$Id: LogDisplayWrapper.java 685685 2008-08-13 21:43:27Z nbubna $
Author:
Henning P. Schmiedehausen

Constructor Summary
LogDisplayWrapper(Log log, String prefix, boolean outputMessages)
          Create a new LogDisplayWrapper
 
Method Summary
 void debug(boolean doLogging, Object message)
          Log a debug message.
 void debug(boolean doLogging, Object message, Throwable t)
          Log a debug message and accompanying Throwable.
 void error(boolean doLogging, Object message)
          Log an error message.
 void error(boolean doLogging, Object message, Throwable t)
          Log an error message and accompanying Throwable.
protected  LogChute getLogChute()
          make sure that we always use the right LogChute Object
 void info(boolean doLogging, Object message)
          Log an info message.
 void info(boolean doLogging, Object message, Throwable t)
          Log an info message and accompanying Throwable.
protected  void log(boolean doLogging, int level, Object message)
           
protected  void log(boolean doLogging, int level, Object message, Throwable t)
           
protected  void log(int level, Object message)
           
protected  void log(int level, Object message, Throwable t)
           
 void trace(boolean doLogging, Object message)
          Log a trace message.
 void trace(boolean doLogging, Object message, Throwable t)
          Log a trace message and accompanying Throwable.
 void warn(boolean doLogging, Object message)
          Log a warning message.
 void warn(boolean doLogging, Object message, Throwable t)
          Log a warning message and accompanying Throwable.
 
Methods inherited from class org.apache.velocity.runtime.log.Log
debug, debug, error, error, formatFileString, formatFileString, formatFileString, formatFileString, info, info, isDebugEnabled, isErrorEnabled, isInfoEnabled, isTraceEnabled, isWarnEnabled, setLogChute, trace, trace, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogDisplayWrapper

public LogDisplayWrapper(Log log,
                         String prefix,
                         boolean outputMessages)
Create a new LogDisplayWrapper

Parameters:
log - The Log object to wrap.
prefix - The prefix to record with all messages.
outputMessages - True when messages should actually get logged.
Method Detail

getLogChute

protected LogChute getLogChute()
make sure that we always use the right LogChute Object

Overrides:
getLogChute in class Log
Returns:
The LogChute wrapped by this Log instance.

log

protected void log(int level,
                   Object message)
Overrides:
log in class Log
See Also:
Log.log(int, Object)

log

protected void log(boolean doLogging,
                   int level,
                   Object message)

log

protected void log(int level,
                   Object message,
                   Throwable t)
Overrides:
log in class Log
See Also:
Log.log(int, Object, Throwable)

log

protected void log(boolean doLogging,
                   int level,
                   Object message,
                   Throwable t)

trace

public void trace(boolean doLogging,
                  Object message)
Log a trace message.

Parameters:
doLogging - Log only if this parameter is true.
message -

trace

public void trace(boolean doLogging,
                  Object message,
                  Throwable t)
Log a trace message and accompanying Throwable.

Parameters:
doLogging - Log only if this parameter is true.
message -
t -

debug

public void debug(boolean doLogging,
                  Object message)
Log a debug message.

Parameters:
doLogging - Log only if this parameter is true.
message -

debug

public void debug(boolean doLogging,
                  Object message,
                  Throwable t)
Log a debug message and accompanying Throwable.

Parameters:
doLogging - Log only if this parameter is true.
message -
t -

info

public void info(boolean doLogging,
                 Object message)
Log an info message.

Parameters:
doLogging - Log only if this parameter is true.
message -

info

public void info(boolean doLogging,
                 Object message,
                 Throwable t)
Log an info message and accompanying Throwable.

Parameters:
doLogging - Log only if this parameter is true.
message -
t -

warn

public void warn(boolean doLogging,
                 Object message)
Log a warning message.

Parameters:
doLogging - Log only if this parameter is true.
message -

warn

public void warn(boolean doLogging,
                 Object message,
                 Throwable t)
Log a warning message and accompanying Throwable.

Parameters:
doLogging - Log only if this parameter is true.
message -
t -

error

public void error(boolean doLogging,
                  Object message)
Log an error message.

Parameters:
doLogging - Log only if this parameter is true.
message -

error

public void error(boolean doLogging,
                  Object message,
                  Throwable t)
Log an error message and accompanying Throwable.

Parameters:
doLogging - Log only if this parameter is true.
message -
t -


Copyright © 2000-2010 The Apache Software Foundation. All Rights Reserved.