Search in sources :

Example 1 with SafeOutputStreamConsumer

use of com.thoughtworks.go.util.command.SafeOutputStreamConsumer in project gocd by gocd.

the class BuildSession method newSafeConsole.

private SafeOutputStreamConsumer newSafeConsole() {
    ProcessOutputStreamConsumer processConsumer = new ProcessOutputStreamConsumer<>(console, console);
    SafeOutputStreamConsumer streamConsumer = new SafeOutputStreamConsumer(processConsumer);
    for (String secret : secretSubstitutions.keySet()) {
        streamConsumer.addSecret(new SecretSubstitution(secret, secretSubstitutions.get(secret)));
    }
    return streamConsumer;
}
Also used : SafeOutputStreamConsumer(com.thoughtworks.go.util.command.SafeOutputStreamConsumer) ProcessOutputStreamConsumer(com.thoughtworks.go.util.command.ProcessOutputStreamConsumer)

Example 2 with SafeOutputStreamConsumer

use of com.thoughtworks.go.util.command.SafeOutputStreamConsumer in project gocd by gocd.

the class BuildWork method dumpEnvironmentVariables.

private void dumpEnvironmentVariables(EnvironmentVariableContext environmentVariableContext) {
    Set<String> processLevelEnvVariables = ProcessManager.getInstance().environmentVariableNames();
    List<String> report = environmentVariableContext.report(processLevelEnvVariables);
    SafeOutputStreamConsumer safeOutput = safeOutputStreamConsumer(environmentVariableContext);
    for (int i = 0; i < report.size(); i++) {
        String line = report.get(i);
        safeOutput.stdOutput((i == report.size() - 1) ? line + "\n" : line);
    }
}
Also used : SafeOutputStreamConsumer(com.thoughtworks.go.util.command.SafeOutputStreamConsumer)

Aggregations

SafeOutputStreamConsumer (com.thoughtworks.go.util.command.SafeOutputStreamConsumer)2 ProcessOutputStreamConsumer (com.thoughtworks.go.util.command.ProcessOutputStreamConsumer)1