@NotThreadSafe public final class ForwardingReport extends Object implements ProcessingReport
This report forwards all its logged messages to another report and only
changes (and retains) its success status to false if a message is
logged at the error level.
| Constructor and Description |
|---|
ForwardingReport(ProcessingReport report)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
debug(ProcessingMessage message)
Log a message with a level of
LogLevel.DEBUG |
void |
error(ProcessingMessage message)
Log a message with a level of
LogLevel.ERROR |
LogLevel |
getExceptionThreshold()
Get the exception threshold of this report
|
LogLevel |
getLogLevel()
Get the log level of this report
|
void |
info(ProcessingMessage message)
Log a message with a level of
LogLevel.INFO |
boolean |
isSuccess()
Tell whether the report is a success
|
Iterator<ProcessingMessage> |
iterator() |
void |
mergeWith(ProcessingReport other)
Merge another report into this report
|
void |
warn(ProcessingMessage message)
Log a message with a level of
LogLevel.WARNING |
public ForwardingReport(ProcessingReport report)
report - the report to forward logged messages topublic LogLevel getLogLevel()
ProcessingReportAny message with a log level greater than, or equal to, the result of this method is logged.
getLogLevel in interface ProcessingReportpublic LogLevel getExceptionThreshold()
ProcessingReportAny message with a log level greater than, or equal to, the result of
this method raises a ProcessingException or any subclass.
getExceptionThreshold in interface ProcessingReportProcessingMessage.asException()public void debug(ProcessingMessage message) throws ProcessingException
ProcessingReportLogLevel.DEBUG
It is the responsibility of the implementation to set the log level of the message appropriately.
debug in interface ProcessingReportmessage - the messageProcessingException - the level of this message grants that an
exception is thrown insteadProcessingReport.getExceptionThreshold(),
ProcessingMessage.setLogLevel(LogLevel)public void info(ProcessingMessage message) throws ProcessingException
ProcessingReportLogLevel.INFO
It is the responsibility of the implementation to set the log level of the message appropriately.
info in interface ProcessingReportmessage - the messageProcessingException - the level of this message grants that an
exception is thrown insteadProcessingReport.getExceptionThreshold(),
ProcessingMessage.setLogLevel(LogLevel)public void warn(ProcessingMessage message) throws ProcessingException
ProcessingReportLogLevel.WARNING
It is the responsibility of the implementation to set the log level of the message appropriately.
warn in interface ProcessingReportmessage - the messageProcessingException - the level of this message grants that an
exception is thrown insteadProcessingReport.getExceptionThreshold(),
ProcessingMessage.setLogLevel(LogLevel)public void error(ProcessingMessage message) throws ProcessingException
ProcessingReportLogLevel.ERROR
It is the responsibility of the implementation to set the log level of the message appropriately.
error in interface ProcessingReportmessage - the messageProcessingException - the level of this message grants that an
exception is thrown insteadProcessingReport.getExceptionThreshold(),
ProcessingMessage.setLogLevel(LogLevel)public boolean isSuccess()
ProcessingReportA report is considered successful if no messages with a level of
LogLevel.ERROR or higher have been logged.
isSuccess in interface ProcessingReportpublic void mergeWith(ProcessingReport other) throws ProcessingException
ProcessingReportmergeWith in interface ProcessingReportother - the other reportProcessingException - a message in the other report has a level
granting that an exception be thrownpublic Iterator<ProcessingMessage> iterator()
iterator in interface Iterable<ProcessingMessage>Copyright © 2013. All Rights Reserved.