improve logging
[teamcity/dotNetPackagesSupport.git] / nuget-server / src / jetbrains / buildServer / nuget / server / exec / NuGetExecutorImpl.java
index a716e25e9fc16d5d6faecfe97c6b07fc25a0c8c8..181479cefbf9cb8abc3e79192fc367446395ec81 100644 (file)
@@ -20,6 +20,7 @@ import com.intellij.execution.configurations.GeneralCommandLine;
 import com.intellij.openapi.diagnostic.Logger;\r
 import jetbrains.buildServer.ExecResult;\r
 import jetbrains.buildServer.SimpleCommandLineProcessRunner;\r
+import jetbrains.buildServer.util.StringUtil;\r
 import org.jetbrains.annotations.NotNull;\r
 \r
 import java.io.File;\r
@@ -56,8 +57,12 @@ public class NuGetExecutorImpl implements NuGetExecutor {
 \r
     if (LOG.isDebugEnabled()) {\r
       LOG.debug("Exited with code: " + result.getExitCode());\r
-      LOG.debug("Output: " + result.getStdout());\r
-      LOG.error("Error: " + result.getStderr());\r
+      if (!StringUtil.isEmptyOrSpaces(result.getStdout())) {\r
+        LOG.debug("Output: " + result.getStdout());\r
+      }\r
+      if (!StringUtil.isEmptyOrSpaces(result.getStderr())) {\r
+        LOG.debug("Error: " + result.getStderr());\r
+      }\r
     }\r
 \r
     listener.onStdOutput(result.getStdout());\r