]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/tasks/SystemCall.java
Improve executions and system calls
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / execution / tasks / SystemCall.java
index 95154ef0f6fcccdf312b1dc910b6052600ba97d5..e5df71ab1ff291de369a271c6e75650888f606b9 100644 (file)
@@ -281,13 +281,15 @@ public class SystemCall extends TreeSRelatedHelper implements Runnable {
                                stdOutputStream != null ? stdOutputStream
                                                : new LogOutputStream() {
                                                        protected void processLine(String line, int level) {
-                                                               log(stdOutLogLevel, line);
+                                                               if (line != null && !line.trim().equals(""))
+                                                                       log(stdOutLogLevel, line);
                                                                if (stdOutWriter != null)
                                                                        appendLineToFile(stdOutWriter, line);
                                                        }
                                                }, new LogOutputStream() {
                                        protected void processLine(String line, int level) {
-                                               log(stdErrLogLevel, line);
+                                               if (line != null && !line.trim().equals(""))
+                                                       log(stdErrLogLevel, line);
                                                if (stdErrWriter != null)
                                                        appendLineToFile(stdErrWriter, line);
                                        }
@@ -301,20 +303,19 @@ public class SystemCall extends TreeSRelatedHelper implements Runnable {
                return new ExecuteResultHandler() {
 
                        public void onProcessComplete(int exitValue) {
+                               String msg = "System call '" + commandLine
+                                               + "' properly completed.";
                                if (log.isDebugEnabled())
-                                       log
-                                                       .debug("Process " + commandLine
-                                                                       + " properly completed.");
+                                       log.debug(msg);
                                if (testResult != null) {
                                        forwardPath(testResult, null);
                                        testResult.addResultPart(new SimpleResultPart(
-                                                       TestStatus.PASSED, "Process " + commandLine
-                                                                       + " properly completed."));
+                                                       TestStatus.PASSED, msg));
                                }
                        }
 
                        public void onProcessFailed(ExecuteException e) {
-                               String msg = "Process " + commandLine + " failed.";
+                               String msg = "System call '" + commandLine + "' failed.";
                                if (testResult != null) {
                                        forwardPath(testResult, null);
                                        testResult.addResultPart(new SimpleResultPart(