more compact logging
authorEugene Zhuravlev <jeka@intellij.com>
Sat, 28 Jan 2012 13:36:27 +0000 (14:36 +0100)
committerEugene Zhuravlev <jeka@intellij.com>
Sat, 28 Jan 2012 13:39:19 +0000 (14:39 +0100)
java/compiler/impl/src/com/intellij/compiler/CompileServerManager.java
jps/jps-builders/src/org/jetbrains/jps/javac/JavacServerBootstrap.java

index d34ce9d92a7bee2e2545bd6aef9a0c3b17cfe82c..9dd764011b140ab3e53f911dd84db50996f0f8f7 100644 (file)
@@ -283,7 +283,7 @@ public class CompileServerManager implements ApplicationComponent{
           // re-translate server's output to idea.log
           final String text = event.getText();
           if (!StringUtil.isEmpty(text)) {
           // re-translate server's output to idea.log
           final String text = event.getText();
           if (!StringUtil.isEmpty(text)) {
-            LOG.info("COMPILE_SERVER [" +outputType.toString() +"]: "+ text);
+            LOG.info("COMPILE_SERVER [" +outputType.toString() +"]: "+ text.trim());
           }
         }
       });
           }
         }
       });
index cdd778e32ff167afcd7e8fc51296a796b087f207..aece320b89a0dfd8787b79a9bf1aa56eb03439dc 100644 (file)
@@ -95,8 +95,13 @@ public class JavacServerBootstrap {
     processHandler.addProcessListener(new ProcessAdapter() {
       public void onTextAvailable(ProcessEvent event, Key outputType) {
         final String text = event.getText();
     processHandler.addProcessListener(new ProcessAdapter() {
       public void onTextAvailable(ProcessEvent event, Key outputType) {
         final String text = event.getText();
-        if (text != null && text.length() > 0) {
-          System.out.print("JAVAC_SERVER [" + outputType.toString() + "]: " + text);
+        if (!StringUtil.isEmpty(text)) {
+          if (outputType == ProcessOutputTypes.STDOUT) {
+            System.out.print("JAVAC_SERVER: " + text);
+          }
+          else if (outputType == ProcessOutputTypes.STDERR){
+            System.err.print("JAVAC_SERVER: " + text);
+          }
         }
       }
     });
         }
       }
     });