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.
This commit is contained in:
Ryan Ernst 2019-05-16 15:35:27 -04:00
parent 51376f98a7
commit c40bd31073
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ public class LoggedExec extends Exec {
}; };
} else { } else {
out = new ByteArrayOutputStream(); 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); setStandardOutput(out);
setErrorOutput(out); setErrorOutput(out);