Skip to content

Commit

Permalink
Improve logging of commands
Browse files Browse the repository at this point in the history
  • Loading branch information
PyvesB committed Jul 16, 2024
1 parent 41a0eb3 commit 328570a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
Expand All @@ -39,7 +38,7 @@ public CommandJob(String gemName, String[] command, String description) {

@Override
protected IStatus run(IProgressMonitor monitor) {
String commandString = List.of(command).toString();
String commandString = "'" + String.join(" ", command) + "'";
LogHelper.info("Running command " + commandString);
monitor.beginTask(description, IProgressMonitor.UNKNOWN);
try {
Expand Down Expand Up @@ -74,7 +73,7 @@ private void monitorOutput(IProgressMonitor monitor, String commandString) {
try (BufferedReader inputReader = new BufferedReader(new InputStreamReader(process.getInputStream()))) {
inputReader.lines().forEachOrdered(monitor::subTask);
} catch (IOException e) {
LogHelper.error("Failed to read output from command " + commandString, e);
LogHelper.error("Failed to read output from command '" + commandString + "'", e);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static Job createJob(ILaunch launch, String command, String workingDirect

public static Job createJob(ILaunch launch, String command, File workingDirectory) {
String[] absolutePlatformCommand = CommandHelper.getAbsolutePlatformCommand(command);
return Job.create("Running " + command, r -> {
return Job.create("Running '" + command + "'", r -> {
try {
Process process = DebugPlugin.exec(absolutePlatformCommand, workingDirectory);
if (process == null) {
Expand Down

0 comments on commit 328570a

Please sign in to comment.