improve logging
authorEugene Petrenko <eugene.petrenko@gmail.com>
Fri, 15 Jul 2011 13:59:00 +0000 (17:59 +0400)
committerEugene Petrenko <eugene.petrenko@gmail.com>
Fri, 15 Jul 2011 13:59:00 +0000 (17:59 +0400)
nuget-server/src/jetbrains/buildServer/nuget/server/exec/ListPackagesCommandProcessor.java
nuget-server/src/jetbrains/buildServer/nuget/server/exec/NuGetExecutorImpl.java

index 01fc45413aedcb65de5ee13340b0e81a43796adb..1dfd8529f959df754de7b45b7519471163ac2b9c 100644 (file)
@@ -68,7 +68,9 @@ public class ListPackagesCommandProcessor implements NuGetOutputProcessor<Collec
   }\r
 \r
   public void onStdError(String text) {\r
   }\r
 \r
   public void onStdError(String text) {\r
-    LOG.warn(text);\r
+    if (!StringUtil.isEmptyOrSpaces(text)) {\r
+      LOG.warn(text);\r
+    }\r
   }\r
 \r
   public void onFinished(int exitCode) {\r
   }\r
 \r
   public void onFinished(int exitCode) {\r
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 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
 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
 \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
     }\r
 \r
     listener.onStdOutput(result.getStdout());\r