Package uk.ac.starlink.ttools.taplint
Class TextOutputReporter
java.lang.Object
uk.ac.starlink.ttools.taplint.TextOutputReporter
- All Implemented Interfaces:
OutputReporter
,Reporter
OutputReporter implementation for logging plain text to a print stream.
- Since:
- 24 May 2016
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionTextOutputReporter
(PrintStream out, ReportType[] types, int maxRepeat, boolean debug, int maxChar) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
end()
Signals end of reporting.void
Ends the current section.Returns the section code for the most recently-started section.void
report
(ReportCode code, String message) Reports a message.void
report
(ReportCode code, String message, Throwable err) Reports a message with an associated throwable.void
Signals beginning of reporting.void
startSection
(String scode, String message) Begins a reporting section.void
Writes to the output stream a summary of messages which were suppressed in a given stage because the maximum repeat count was exceeded.
-
Constructor Details
-
TextOutputReporter
public TextOutputReporter(PrintStream out, ReportType[] types, int maxRepeat, boolean debug, int maxChar) Constructor.- Parameters:
out
- destination streamtypes
- message types to report; others are discardedmaxRepeat
- maximum number of times any given message may be repeated; subsequent instances are suppresseddebug
- true iff you want to see full stacktraces for exceptions etcmaxChar
- maximum number of total characters per line of output
-
-
Method Details
-
start
Description copied from interface:OutputReporter
Signals beginning of reporting.- Specified by:
start
in interfaceOutputReporter
- Parameters:
announcements
- header information about validator operation; plain text, one line per element
-
end
public void end()Description copied from interface:OutputReporter
Signals end of reporting.- Specified by:
end
in interfaceOutputReporter
-
startSection
Description copied from interface:OutputReporter
Begins a reporting section.- Specified by:
startSection
in interfaceOutputReporter
- Parameters:
scode
- short fixed-length (3-char?) identifier for the section about to startmessage
- terse (one-line) free-text description of the stage
-
getSectionCode
Description copied from interface:OutputReporter
Returns the section code for the most recently-started section.- Specified by:
getSectionCode
in interfaceOutputReporter
- Returns:
- current section code
-
summariseUnreportedMessages
Description copied from interface:OutputReporter
Writes to the output stream a summary of messages which were suppressed in a given stage because the maximum repeat count was exceeded.- Specified by:
summariseUnreportedMessages
in interfaceOutputReporter
- Parameters:
scode
- section code to summarise; if null, no stage filtering is done
-
endSection
public void endSection()Description copied from interface:OutputReporter
Ends the current section.- Specified by:
endSection
in interfaceOutputReporter
-
report
Description copied from interface:Reporter
Reports a message.This convenience method is equivalent to calling
report(code,message,null)
-
report
Description copied from interface:Reporter
Reports a message with an associated throwable.
-