use of com.synopsys.integration.executable.ExecutableRunner in project synopsys-detect by blackducksoftware.
the class DetectExecutableRunner method execute.
@NotNull
public ExecutableOutput execute(Executable executable, boolean outputContainsSecret) throws ExecutableRunnerException {
ExecutableRunner targetRunner = runner;
if (outputContainsSecret) {
targetRunner = secretRunner;
}
ExecutableOutput output = targetRunner.execute(executable);
eventSystem.publishEvent(Event.Executable, new ExecutedExecutable(output, executable));
boolean normallyLogOutput = output.getReturnCode() != 0 && shouldLogOutput && !logger.isDebugEnabled() && !logger.isTraceEnabled();
if (normallyLogOutput && !outputContainsSecret) {
if (StringUtils.isNotBlank(output.getStandardOutput())) {
logger.info("Standard Output: ");
logger.info(output.getStandardOutput());
}
if (StringUtils.isNotBlank(output.getErrorOutput())) {
logger.info("Error Output: ");
logger.info(output.getErrorOutput());
}
}
return output;
}
Aggregations