Class 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 Detail

      • JSON_WRITER

        protected static final com.fasterxml.jackson.databind.ObjectWriter JSON_WRITER
        The JSON writer
    • Constructor Detail

      • AbstractExecResultLogger

        public AbstractExecResultLogger()
    • Method Detail

      • log

        public void log​(T result,
                        ExecOptions execOptions)
        Log the result in the specified format
        Parameters:
        result - the result
        execOptions - 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
      • formatMarkdown

        protected abstract String formatMarkdown​(T result,
                                                 Verbosity verbosity)
        Format the result for markdown output format
        Parameters:
        result - the result
        verbosity - the output verbosity
        Returns:
        the formatted markdown output