From d8b146bb731eb0f084cc236d0498f335ddda6bf6 Mon Sep 17 00:00:00 2001 From: Martin Choma Date: Tue, 13 Feb 2024 08:23:53 +0100 Subject: [PATCH] [#557] Add some logging for better troubleshooting --- core/src/main/java/cz/xtf/core/openshift/CLIUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/cz/xtf/core/openshift/CLIUtils.java b/core/src/main/java/cz/xtf/core/openshift/CLIUtils.java index 66e8dadf..2baba032 100644 --- a/core/src/main/java/cz/xtf/core/openshift/CLIUtils.java +++ b/core/src/main/java/cz/xtf/core/openshift/CLIUtils.java @@ -24,6 +24,7 @@ public static String executeCommand(Map environmentVariables, St pb.redirectError(ProcessBuilder.Redirect.PIPE); try { + log.debug("executing local command: {}", String.join(" ", args)); Process p = pb.start(); ExecutorService es = Executors.newFixedThreadPool(2); @@ -45,7 +46,9 @@ public static String executeCommand(Map environmentVariables, St int result = p.waitFor(); if (result == 0) { - return out.get(); + String commandOutput = out.get(); + log.debug(commandOutput); + return commandOutput; } else { log.error("Failed while executing (code {}): {}", result, String.join(" ", args)); log.error(err.get());