org.apache.velocity.test.misc
Class TestLogChute

java.lang.Object
  extended by org.apache.velocity.runtime.log.SystemLogChute
      extended by org.apache.velocity.test.misc.TestLogChute
All Implemented Interfaces:
LogChute

public class TestLogChute
extends SystemLogChute

LogChute implementation that can easily capture output or suppress it entirely. By default, both capture and suppress are on. To have this behave like a normal SystemLogChute, you must turn it on() and stopCapture().

Version:
$Id: TestLogChute.java 697214 2008-09-19 19:55:59Z nbubna $
Author:
Will Glass-Husain, Nathan Bubna

Field Summary
static String TEST_LOGGER_LEVEL
           
 
Fields inherited from class org.apache.velocity.runtime.log.SystemLogChute
RUNTIME_LOG_LEVEL_KEY, RUNTIME_LOG_SYSTEM_ERR_LEVEL_KEY
 
Fields inherited from interface org.apache.velocity.runtime.log.LogChute
DEBUG_ID, DEBUG_PREFIX, ERROR_ID, ERROR_PREFIX, INFO_ID, INFO_PREFIX, TRACE_ID, TRACE_PREFIX, WARN_ID, WARN_PREFIX
 
Constructor Summary
TestLogChute()
           
TestLogChute(boolean suppress, boolean capture)
           
 
Method Summary
 String getLog()
          Return the captured log messages to date.
 void init(RuntimeServices rs)
           
 boolean isLevelEnabled(int level)
           
 void off()
           
 void on()
           
 void startCapture()
           
 void stopCapture()
           
protected  void write(PrintStream ps, String prefix, String message, Throwable t)
           
 
Methods inherited from class org.apache.velocity.runtime.log.SystemLogChute
getEnabledLevel, getPrefix, getSystemErrLevel, log, log, setEnabledLevel, setSystemErrLevel, toLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEST_LOGGER_LEVEL

public static final String TEST_LOGGER_LEVEL
See Also:
Constant Field Values
Constructor Detail

TestLogChute

public TestLogChute()

TestLogChute

public TestLogChute(boolean suppress,
                    boolean capture)
Method Detail

init

public void init(RuntimeServices rs)
          throws Exception
Specified by:
init in interface LogChute
Overrides:
init in class SystemLogChute
Throws:
Exception

on

public void on()

off

public void off()

startCapture

public void startCapture()

stopCapture

public void stopCapture()

isLevelEnabled

public boolean isLevelEnabled(int level)
Specified by:
isLevelEnabled in interface LogChute
Overrides:
isLevelEnabled in class SystemLogChute

write

protected void write(PrintStream ps,
                     String prefix,
                     String message,
                     Throwable t)
Overrides:
write in class SystemLogChute

getLog

public String getLog()
Return the captured log messages to date.

Returns:
log messages


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