Package com.optum.sourcehawk.exec
Class AbstractExecResultLogger<T>
- java.lang.Object
-
- com.optum.sourcehawk.exec.AbstractExecResultLogger<T>
-
- Type Parameters:
T- the type of result to log
- Direct Known Subclasses:
FixResultLogger,ScanResultLogger
public abstract class AbstractExecResultLogger<T> extends Object
A generic logger for logging results- Author:
- Brian Wyka
-
-
Field Summary
Fields Modifier and Type Field Description protected static com.fasterxml.jackson.databind.ObjectWriterJSON_WRITERThe JSON writer
-
Constructor Summary
Constructors Constructor Description AbstractExecResultLogger()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected StringformatJson(T result)Format the scan result for JSON output formatprotected abstract StringformatMarkdown(T result, Verbosity verbosity)Format the result for markdown output formatprotected abstract Collection<Pair<Severity,Pair<String,String>>>formatTextMessages(T result)Format the result messages for text outputprotected abstract Pair<Severity,String>formatTextSummary(T result)Format the summary for plain text output formatvoidlog(T result, ExecOptions execOptions)Log the result in the specified format
-
-
-
Method Detail
-
log
public void log(T result, ExecOptions execOptions)
Log the result in the specified format- Parameters:
result- the resultexecOptions- the scan options
-
formatTextSummary
protected abstract Pair<Severity,String> formatTextSummary(T result)
Format the summary for plain text output format- Parameters:
result- the result- Returns:
- the formatted text output for the summary
-
formatTextMessages
protected abstract Collection<Pair<Severity,Pair<String,String>>> formatTextMessages(T result)
Format the result messages for text output- Parameters:
result- the result- Returns:
- the formatted text log statements
-
formatJson
protected String formatJson(T result)
Format the scan result for JSON output format- Parameters:
result- the result- Returns:
- the formatted JSON output
-
-