Package org.apache.struts.util
Class TestLoggerFactory
java.lang.Object
org.apache.struts.util.TestLoggerFactory
- All Implemented Interfaces:
ILoggerFactory
An implementation of
ILoggerFactory which always returns
TestLogger instances.- Since:
- Struts 1.4.2
- Author:
- Stefan Graff
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String, TestLogger> TheTestLoggerinstances that have already been created, keyed by logger name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearOutput(Class<?> clazz) Clears/Delete all log-messages of the class.voidclearOutput(String name) Clears/Delete all log-messages of a named logger.Return an appropriateTestLoggerinstance by name.Returns all collected log-messages to a class.Returns all collected log-messages to a named logger.voidrelease()Clears/Delete all log-messages of all loggers.
-
Field Details
-
instances
TheTestLoggerinstances that have already been created, keyed by logger name.
-
-
Constructor Details
-
TestLoggerFactory
public TestLoggerFactory()Constructor
-
-
Method Details
-
getLogger
Return an appropriateTestLoggerinstance by name.- Specified by:
getLoggerin interfaceILoggerFactory
-
getOutput
Returns all collected log-messages to a class.- Parameters:
clazz- the logged class- Returns:
- all collected log-messages
-
getOutput
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
Clears/Delete all log-messages of the class.- Parameters:
clazz- the logged class
-
clearOutput
Clears/Delete all log-messages of a named logger.- Parameters:
name- the name of the logger
-