org.apache.velocity.runtime.log
Class Log

java.lang.Object
  extended by org.apache.velocity.runtime.log.Log
Direct Known Subclasses:
LogDisplayWrapper, RuntimeLoggerLog

public class Log
extends Object

Convenient wrapper for LogChute functions. This implements the RuntimeLogger methods (and then some). It is hoped that use of this will fully replace use of the RuntimeLogger.

Version:
$Id: Log.java 469919 2006-11-01 14:35:46Z henning $
Author:
Nathan Bubna

Constructor Summary
Log()
          Creates a new Log that wraps a HoldingLogChute.
Log(LogChute chute)
          Creates a new Log that wraps the specified LogChute.
 
Method Summary
 void debug(Object message)
          Log a debug message.
 void debug(Object message, Throwable t)
          Log a debug message and accompanying Throwable.
 void error(Object message)
          Log an error message.
 void error(Object message, Throwable t)
          Log an error message and accompanying Throwable.
protected  LogChute getLogChute()
          Returns the LogChute wrapped by this Log instance.
 void info(Object message)
          Log an info message.
 void info(Object message, Throwable t)
          Log an info message and accompanying Throwable.
 boolean isDebugEnabled()
          Returns true if debug level messages will be printed by the LogChute.
 boolean isErrorEnabled()
          Returns true if error level messages will be printed by the LogChute.
 boolean isInfoEnabled()
          Returns true if info level messages will be printed by the LogChute.
 boolean isTraceEnabled()
          Returns true if trace level messages will be printed by the LogChute.
 boolean isWarnEnabled()
          Returns true if warn level messages will be printed by the LogChute.
protected  void log(int level, Object message)
           
protected  void log(int level, Object message, Throwable t)
           
protected  void setLogChute(LogChute chute)
          Updates the LogChute wrapped by this Log instance.
 void trace(Object message)
          Log a trace message.
 void trace(Object message, Throwable t)
          Log a trace message and accompanying Throwable.
 void warn(Object message)
          Log a warning message.
 void warn(Object message, Throwable t)
          Log a warning message and accompanying Throwable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log

public Log()
Creates a new Log that wraps a HoldingLogChute.


Log

public Log(LogChute chute)
Creates a new Log that wraps the specified LogChute.

Parameters:
chute -
Method Detail

setLogChute

protected void setLogChute(LogChute chute)
Updates the LogChute wrapped by this Log instance.

Parameters:
chute - The new value for the log chute.

getLogChute

protected LogChute getLogChute()
Returns the LogChute wrapped by this Log instance.

Returns:
The LogChute wrapped by this Log instance.

log

protected void log(int level,
                   Object message)

log

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

isTraceEnabled

public boolean isTraceEnabled()
Returns true if trace level messages will be printed by the LogChute.

Returns:
If trace level messages will be printed by the LogChute.

trace

public void trace(Object message)
Log a trace message.

Parameters:
message -

trace

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

Parameters:
message -
t -

isDebugEnabled

public boolean isDebugEnabled()
Returns true if debug level messages will be printed by the LogChute.

Returns:
True if debug level messages will be printed by the LogChute.

debug

public void debug(Object message)
Log a debug message.

Parameters:
message -

debug

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

Parameters:
message -
t -

isInfoEnabled

public boolean isInfoEnabled()
Returns true if info level messages will be printed by the LogChute.

Returns:
True if info level messages will be printed by the LogChute.

info

public void info(Object message)
Log an info message.

Parameters:
message -

info

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

Parameters:
message -
t -

isWarnEnabled

public boolean isWarnEnabled()
Returns true if warn level messages will be printed by the LogChute.

Returns:
True if warn level messages will be printed by the LogChute.

warn

public void warn(Object message)
Log a warning message.

Parameters:
message -

warn

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

Parameters:
message -
t -

isErrorEnabled

public boolean isErrorEnabled()
Returns true if error level messages will be printed by the LogChute.

Returns:
True if error level messages will be printed by the LogChute.

error

public void error(Object message)
Log an error message.

Parameters:
message -

error

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

Parameters:
message -
t -


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