Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

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

Inheritance diagram for alma::acs::testsupport::LogRecordCollectingLogger:

Inheritance 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

synchronized LogRecordCollectingLogger getCollectingLogger (String name)
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]
 

synchronized<T extends LogRecordCollectingLogger> T alma::acs::testsupport::LogRecordCollectingLogger::getCollectingLogger String  name,
Class< T >  loggerClass
[inline, static]
 

synchronized LogRecordCollectingLogger alma::acs::testsupport::LogRecordCollectingLogger::getCollectingLogger String  name  )  [inline, static]
 

See also:
java.util.logging.Logger#getLogger(java.lang.String)

void alma::acs::testsupport::LogRecordCollectingLogger::log LogRecord  record  )  [inline]
 

Here we intercept all logging activities of the base class.

See also:
java.util.logging.Logger#log(java.util.logging.LogRecord)

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)

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)


Member Data Documentation

Logger alma::acs::testsupport::LogRecordCollectingLogger::delegate [private]
 

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

boolean alma::acs::testsupport::LogRecordCollectingLogger::suppressLogs = false [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:54:34 2009 for ACS Java API by doxygen 1.3.8