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
Modifier and TypeFieldDescriptionprotected Map
<String, TestLogger> TheTestLogger
instances that have already been created, keyed by logger name. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clearOutput
(Class<?> clazz) Clears/Delete all log-messages of the class.void
clearOutput
(String name) Clears/Delete all log-messages of a named logger.Return an appropriateTestLogger
instance by name.Returns all collected log-messages to a class.Returns all collected log-messages to a named logger.void
release()
Clears/Delete all log-messages of all loggers.
-
Field Details
-
instances
TheTestLogger
instances that have already been created, keyed by logger name.
-
-
Constructor Details
-
TestLoggerFactory
public TestLoggerFactory()Constructor
-
-
Method Details
-
getLogger
Return an appropriateTestLogger
instance by name.- Specified by:
getLogger
in 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
-