Class TestLoggerFactory

java.lang.Object
org.apache.struts.util.TestLoggerFactory
All Implemented Interfaces:
ILoggerFactory

public class TestLoggerFactory extends Object implements ILoggerFactory
An implementation of ILoggerFactory which always returns TestLogger instances.
Since:
Struts 1.4.2
Author:
Stefan Graff
  • Field Details

  • Constructor Details

    • TestLoggerFactory

      public TestLoggerFactory()
      Constructor
  • Method Details

    • getLogger

      public Logger getLogger(String name)
      Return an appropriate TestLogger instance by name.
      Specified by:
      getLogger in interface ILoggerFactory
    • getOutput

      public String getOutput(Class<?> clazz)
      Returns all collected log-messages to a class.
      Parameters:
      clazz - the logged class
      Returns:
      all collected log-messages
    • getOutput

      public String getOutput(String name)
      Returns all collected log-messages to a named logger.
      Parameters:
      name - the name of the logger
      Returns:
      all collected log-messages
    • release

      public void release()
      Clears/Delete all log-messages of all loggers.
    • clearOutput

      public void clearOutput(Class<?> clazz)
      Clears/Delete all log-messages of the class.
      Parameters:
      clazz - the logged class
    • clearOutput

      public void clearOutput(String name)
      Clears/Delete all log-messages of a named logger.
      Parameters:
      name - the name of the logger