From cd97fb10361631abd2ca97f18e7d48b32376884a Mon Sep 17 00:00:00 2001 From: azarum Date: Sat, 3 Aug 2019 00:58:54 +0100 Subject: [PATCH] log conda output (#588) ## Upstream SPARK-XXXXX ticket and PR link (if not applicable, explain) When running verbose conda commands, outputs via `log.info` are not being logged, but outputs with `logInfo` are. We also want to log the conda command in the case the verbosity flag is on (>0). ## What changes were proposed in this pull request? Change the logging of the conda command to `logInfo` and log the command when the verbosity flag is on. ## How was this patch tested? N/A. --- .../org/apache/spark/api/conda/CondaEnvironmentManager.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/scala/org/apache/spark/api/conda/CondaEnvironmentManager.scala b/core/src/main/scala/org/apache/spark/api/conda/CondaEnvironmentManager.scala index 5737a6d976eb2..22abb934a22d6 100644 --- a/core/src/main/scala/org/apache/spark/api/conda/CondaEnvironmentManager.scala +++ b/core/src/main/scala/org/apache/spark/api/conda/CondaEnvironmentManager.scala @@ -177,12 +177,15 @@ final class CondaEnvironmentManager(condaBinaryPath: String, BasicIO.processFully((redactCredentials _).andThen(line => { out.append(line) out.append(BasicIO.Newline) + if (verbosity > 0) { + logInfo(s" $line") + } () })), BasicIO.processFully((redactCredentials _).andThen(line => { err.append(line) err.append(BasicIO.Newline) - log.info(s" $line") + logInfo(s" $line") }))) val exitCode = command.run(collectErrOutToBuffer).exitValue() if (exitCode != 0) {