Cleanup (logging; formatting)

GitOrigin-RevId: f9ce235b02f6c2289d8811d028e1339e69b372e7
This commit is contained in:
Roman Shevchenko
2020-12-21 08:24:31 +00:00
committed by intellij-monorepo-bot
parent 448f4a3242
commit 97f2b953ea
2 changed files with 12 additions and 16 deletions
@@ -9,7 +9,6 @@ import java.util.ArrayList;
import java.util.List;
public final class WSLCommandLineOptions {
private boolean myLaunchWithWslExe = true;
private boolean myExecuteCommandInShell = true;
private boolean mySudo = false;
@@ -44,8 +44,7 @@ final class WslDistributionDescriptor {
/**
* Necessary for serializer
*/
WslDistributionDescriptor() {
}
WslDistributionDescriptor() { }
WslDistributionDescriptor(@NotNull String msId) {
this(msId, msId, null, msId);
@@ -163,28 +162,26 @@ final class WslDistributionDescriptor {
@Nullable
private List<String> readWSLOutput(WSLCommandLineOptions options, List<@NonNls String> command) {
WSLDistribution distribution = WSLUtil.getDistributionById(getId());
if (distribution == null) {
return null;
}
ProcessOutput pwdOutput;
if (distribution == null) return null;
ProcessOutput output;
try {
pwdOutput = distribution.executeOnWsl(command, options, -1, null);
output = distribution.executeOnWsl(command, options, -1, null);
}
catch (ExecutionException e) {
LOG.warn("Error reading pwd output for " + getId(), e);
LOG.warn("Start failed on " + getId(), e);
return null;
}
if (pwdOutput.getExitCode() != 0) {
LOG.info("Non-zero exit code while fetching pwd: " +
"[id=" + getId() + "; " +
"[exitCode=" + pwdOutput.getExitCode() + "; " +
"[stderr=" + pwdOutput.getStderr() + "; " +
"[stdout=" + pwdOutput.getStdout() + "]");
if (output.getExitCode() != 0) {
LOG.info("Execution failed on " + getId() +
" [exitCode=" + output.getExitCode() +
"; stderr=" + output.getStderr() +
"; stdout=" + output.getStdout() + "]");
return null;
}
return pwdOutput.getStdoutLines();
return output.getStdoutLines();
}
@NonNls @Nullable