|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.taplint.Reporter
public class Reporter
Handles logging for validation messages. The design (a single-level hierarchy of reporting stages) is not particularly elegant or general, and may be revised at some point, but is serves the current purposes of the TapLint tool.
Constructor Summary | |
---|---|
Reporter(PrintStream out,
ReportType[] types,
int maxRepeat,
boolean debug,
int maxChar)
Constructor. |
Method Summary | |
---|---|
void |
clear()
Clears any memory of which messages have been reported. |
void |
end()
Signals end of reporting. |
void |
endSection()
Ends the current section. |
String |
getSectionCode()
Returns the section code for the most recently-started section. |
void |
println(String line)
Writes a single line of text, truncating as required. |
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 |
reportTotals()
Prints the total number of each report type reported by this object. |
void |
start()
Signals beginning of reporting. |
void |
startSection(String scode,
String message)
Begins a reporting section. |
void |
summariseUnreportedMessages(String scode)
Writes to the output stream a summary of messages which were suppressed in a given stage because the maximum repeat count was exceeded. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Reporter(PrintStream out, ReportType[] types, int maxRepeat, boolean debug, int maxChar)
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 outputMethod Detail |
---|
public void start()
public void end()
public void startSection(String scode, String message)
scode
- short fixed-length (3-char?) identifier for the
section about to startmessage
- terse (one-line) free-text description of the stagepublic String getSectionCode()
public void summariseUnreportedMessages(String scode)
scode
- section code to summarisepublic void endSection()
public void report(ReportCode code, String message)
code
- report code; messages with the same code should
identify essentially the same conditionmessage
- free-text message; it may be multi-line and/or
longish, but may in practice be truncated on outputpublic void report(ReportCode code, String message, Throwable err)
code
- report code; messages with the same code should
identify essentially the same conditionmessage
- free-text message; it may be multi-line and/or
longish, but may in practice be truncated on outputerr
- throwablepublic void clear()
public void reportTotals()
public void println(String line)
line
- line to print
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |