Search in sources :

Example 1 with InfoLogReportWriter

use of com.blackducksoftware.integration.hub.detect.workflow.report.writer.InfoLogReportWriter in project hub-detect by blackducksoftware.

the class DiagnosticReportHandler method createReportWriter.

private ReportWriter createReportWriter(final ReportTypes reportType) {
    try {
        final File reportFile = new File(reportDirectory, reportType.getReportFileName() + ".txt");
        final FileReportWriter fileReportWriter = new FileReportWriter(reportFile, reportType.getReportTitle(), reportType.getReportDescription(), runId);
        reportWriters.put(reportType, fileReportWriter);
        logger.info("Created report file: " + reportFile.getPath());
        return fileReportWriter;
    } catch (final Exception e) {
        logger.error("Failed to create report writer: " + reportType.toString(), e);
    }
    return new InfoLogReportWriter();
}
Also used : InfoLogReportWriter(com.blackducksoftware.integration.hub.detect.workflow.report.writer.InfoLogReportWriter) FileReportWriter(com.blackducksoftware.integration.hub.detect.workflow.report.writer.FileReportWriter) File(java.io.File)

Example 2 with InfoLogReportWriter

use of com.blackducksoftware.integration.hub.detect.workflow.report.writer.InfoLogReportWriter in project hub-detect by blackducksoftware.

the class ExtractionManager method extract.

private void extract(final DetectorEvaluation result) {
    // TODO: Replace reporting.
    logger.info("Starting extraction: " + result.getDetector().getDetectorType() + " - " + result.getDetector().getName());
    logger.info("Identifier: " + result.getExtractionId().toUniqueString());
    ObjectPrinter.printObjectPrivate(new InfoLogReportWriter(), result.getDetector());
    logger.info(ReportConstants.SEPERATOR);
    try {
        result.setExtraction(result.getDetector().extract(result.getExtractionId()));
    } catch (final Exception e) {
        result.setExtraction(new Extraction.Builder().exception(e).build());
    }
    logger.info(ReportConstants.SEPERATOR);
    logger.info("Finished extraction: " + result.getExtraction().result.toString());
    logger.info("Code locations found: " + result.getExtraction().codeLocations.size());
    if (result.getExtraction().result == ExtractionResultType.EXCEPTION) {
        logger.error("Exception:", result.getExtraction().error);
    } else if (result.getExtraction().result == ExtractionResultType.FAILURE) {
        logger.info(result.getExtraction().description);
    }
    logger.info(ReportConstants.SEPERATOR);
}
Also used : InfoLogReportWriter(com.blackducksoftware.integration.hub.detect.workflow.report.writer.InfoLogReportWriter)

Example 3 with InfoLogReportWriter

use of com.blackducksoftware.integration.hub.detect.workflow.report.writer.InfoLogReportWriter in project hub-detect by blackducksoftware.

the class BootManager method printConfiguration.

private void printConfiguration(boolean fullConfiguration, List<DetectOption> detectOptions) {
    DetectConfigurationReporter detectConfigurationReporter = new DetectConfigurationReporter();
    InfoLogReportWriter infoLogReportWriter = new InfoLogReportWriter();
    if (!fullConfiguration) {
        detectConfigurationReporter.print(infoLogReportWriter, detectOptions);
    }
    detectConfigurationReporter.printWarnings(infoLogReportWriter, detectOptions);
}
Also used : InfoLogReportWriter(com.blackducksoftware.integration.hub.detect.workflow.report.writer.InfoLogReportWriter) DetectConfigurationReporter(com.blackducksoftware.integration.hub.detect.workflow.report.DetectConfigurationReporter)

Aggregations

InfoLogReportWriter (com.blackducksoftware.integration.hub.detect.workflow.report.writer.InfoLogReportWriter)3 DetectConfigurationReporter (com.blackducksoftware.integration.hub.detect.workflow.report.DetectConfigurationReporter)1 FileReportWriter (com.blackducksoftware.integration.hub.detect.workflow.report.writer.FileReportWriter)1 File (java.io.File)1