Class LogDisplayWrapper

java.lang.Object
org.apache.velocity.runtime.log.Log
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 Details

    • 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 Details

    • 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

      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

      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 -