Package edu.hm.hafner.analysis
Class FilteredLog
java.lang.Object
edu.hm.hafner.analysis.FilteredLog
Filters the log of a
Report instance so that only a limited number of errors will be reported. If the number
of errors exceeds this limit, then subsequent error messages will be skipped.- Author:
- Ullrich Hafner
-
Constructor Summary
ConstructorsConstructorDescriptionFilteredLog(Report report, String title) Creates a newFilteredLogfor aReport.FilteredLog(Report report, String title, int maxLines) Creates a newFilteredLogfor aReport. -
Method Summary
Modifier and TypeMethodDescriptionvoidLogs the specified error message.voidlogException(Exception exception, String format, Object... args) Logs the specified exception.voidLogs the specified information message.voidWrites a summary message to the reports' error log that denotes the total number of errors that have been reported.intsize()Returns the total number of errors that have been reported.
-
Constructor Details
-
FilteredLog
- Parameters:
report- the report to filter the error logtitle- the title of the error messages
-
FilteredLog
Creates a newFilteredLogfor aReport.- Parameters:
report- the report to filter the error logtitle- the title of the error messagesmaxLines- the maximum number of lines to log
-
-
Method Details
-
logInfo
Logs the specified information message. Use this method to log any useful information when composing this log.- Parameters:
format- A format stringargs- Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero.
-
logError
Logs the specified error message. Use this method to log any error when composing this log.- Parameters:
format- A format stringargs- Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero.
-
logException
Logs the specified exception. Use this method to log any exception when composing this log.- Parameters:
exception- the exception to logformat- A format stringargs- Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero.
-
size
public int size()Returns the total number of errors that have been reported.- Returns:
- the total number of errors
-
logSummary
public void logSummary()Writes a summary message to the reports' error log that denotes the total number of errors that have been reported.
-