From c40bd31073a5c721bf7bd4d112cd7a46f377de2c Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Thu, 16 May 2019 15:35:27 -0400 Subject: [PATCH] Use local outputstream reference (#42180) This commit fixes the logging in LoggedExec which uses an in memory buffer to read from a local reference, instead of with getStandardOutput() of the Exec task. This is due to gradle internally wrapping with a TeeOutputStream, breaking our cast. --- .../minimumRuntime/org/elasticsearch/gradle/LoggedExec.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/minimumRuntime/org/elasticsearch/gradle/LoggedExec.java b/buildSrc/src/main/minimumRuntime/org/elasticsearch/gradle/LoggedExec.java index a3f87572932..233431ff3c4 100644 --- a/buildSrc/src/main/minimumRuntime/org/elasticsearch/gradle/LoggedExec.java +++ b/buildSrc/src/main/minimumRuntime/org/elasticsearch/gradle/LoggedExec.java @@ -70,7 +70,7 @@ public class LoggedExec extends Exec { }; } else { out = new ByteArrayOutputStream(); - outputLogger = logger -> logger.error(((ByteArrayOutputStream) getStandardOutput()).toString(StandardCharsets.UTF_8)); + outputLogger = logger -> logger.error(((ByteArrayOutputStream) out).toString(StandardCharsets.UTF_8)); } setStandardOutput(out); setErrorOutput(out);