Skip to content

Commit

Permalink
[#557] Add some logging for better troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
mchoma authored and mnovak1 committed Feb 13, 2024
1 parent adde3ab commit d8b146b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/main/java/cz/xtf/core/openshift/CLIUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public static String executeCommand(Map<String, String> 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);
Expand All @@ -45,7 +46,9 @@ public static String executeCommand(Map<String, String> 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());
Expand Down

0 comments on commit d8b146b

Please sign in to comment.