alma::acs::testsupport::LogRecordCollectingLogger Class Reference

Inheritance diagram for alma::acs::testsupport::LogRecordCollectingLogger:
Inheritance graph
[legend]
Collaboration diagram for alma::acs::testsupport::LogRecordCollectingLogger:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void log (LogRecord record)
LogRecord[] getCollectedLogRecords ()
void clearLogRecords ()
void suppressLogs (boolean suppressLogs)
void setDelegateLogger (Logger delegate)

Static Public Member Functions

static synchronized
LogRecordCollectingLogger 
getCollectingLogger (String name)
static synchronized< T extends
LogRecordCollectingLogger > T 
getCollectingLogger (String name, Class< T > loggerClass)

Protected Member Functions

 LogRecordCollectingLogger (String name, String resourceBundleName)

Private Attributes

List< LogRecord > logRecordList = Collections.synchronizedList(new ArrayList<LogRecord>())
boolean suppressLogs = false
Logger delegate

Detailed Description

Creates a Logger that collects all LogRecords produced by calls to the various log methods. This can be used to verify log messages in a pure JUnit environment, without the need to use TAT reference files.

Author:
hsommer created Apr 20, 2005 2:30:47 PM

Constructor & Destructor Documentation

alma::acs::testsupport::LogRecordCollectingLogger::LogRecordCollectingLogger ( String  name,
String  resourceBundleName 
) [inline, protected]

Member Function Documentation

void alma::acs::testsupport::LogRecordCollectingLogger::clearLogRecords (  )  [inline]
LogRecord [] alma::acs::testsupport::LogRecordCollectingLogger::getCollectedLogRecords (  )  [inline]
static synchronized<T extends LogRecordCollectingLogger> T alma::acs::testsupport::LogRecordCollectingLogger::getCollectingLogger ( String  name,
Class< T >  loggerClass 
) [inline, static]
static synchronized LogRecordCollectingLogger alma::acs::testsupport::LogRecordCollectingLogger::getCollectingLogger ( String  name  )  [inline, static]
void alma::acs::testsupport::LogRecordCollectingLogger::log ( LogRecord  record  )  [inline]
void alma::acs::testsupport::LogRecordCollectingLogger::setDelegateLogger ( Logger  delegate  )  [inline]
Parameters:
delegate a logger to receive log output from this logger, or null to not log any output, but only store the log records.
See also:
suppressLogs(boolean)

References suppressLogs.

Referenced by alma::acs::container::CleaningThreadFactoryTest::setUp(), and alma::acs::concurrent::ThreadLoopRunnerTest::testSimple().

void alma::acs::testsupport::LogRecordCollectingLogger::suppressLogs ( boolean  suppressLogs  )  [inline]

Switches real logging off/on. Logging will only happen if a real logger has been provided.

Parameters:
suppressLogs true if collected LogRecords should not be sent to a real logger
See also:
setDelegateLogger(Logger)

Referenced by alma::acs::logging::RemoteLogDispatcherTest::setUp().


Member Data Documentation

Referenced by log().

List<LogRecord> alma::acs::testsupport::LogRecordCollectingLogger::logRecordList = Collections.synchronizedList(new ArrayList<LogRecord>()) [private]

Referenced by log(), and setDelegateLogger().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2