]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7168 replace System.err with LOG.trace in Monitor and Lifecycle
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Mon, 11 Jan 2016 08:33:34 +0000 (09:33 +0100)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Wed, 13 Jan 2016 12:42:43 +0000 (13:42 +0100)
server/sonar-process-monitor/src/main/java/org/sonar/process/monitor/Monitor.java
server/sonar-process/src/main/java/org/sonar/process/Lifecycle.java

index 7dcf8ede0d0f8d4501eae75f3300fa463dc20070..e2e50bb0724dfc5780cf86446c805e6ee0d4e56e 100644 (file)
@@ -158,9 +158,9 @@ public class Monitor {
 
   boolean waitForOneRestart() {
     boolean restartRequested = awaitChildProcessesTermination();
-    trace("finished waiting, restartRequested=" + restartRequested);
+    trace("finished waiting, restartRequested={}", restartRequested);
     if (restartRequested) {
-      trace("awaitTermination(restartor)=" + restartor);
+      trace("awaitTermination restartor={}", restartor);
       awaitTermination(restartor);
     }
     return restartRequested;
@@ -203,7 +203,7 @@ public class Monitor {
   private void cleanAfterTermination() {
     trace("go to STOPPED...");
     if (lifecycle.tryToMoveTo(State.STOPPED)) {
-      trace("await termination of restartWatcher...");
+      trace("await termination of restartWatcher and hardStopWatcher...");
       // wait for restartWatcher and hardStopWatcher to cleanly stop
       awaitTermination(restartWatcher, hardStopWatcher);
       trace("restartWatcher done");
@@ -406,7 +406,11 @@ public class Monitor {
   }
 
   private static void trace(String s) {
-    System.err.println("APP: " + s);
+    LOG.trace(s);
+  }
+
+  private static void trace(String s, Object args) {
+    LOG.trace(s, args);
   }
 
   public static int getNextProcessId() {
index 18a747e14e4b454d8969115ec5e7a42ae190a884..5d570c70e5a44e14f7de7a9026c2eef78a89ceb4 100644 (file)
@@ -82,7 +82,7 @@ public class Lifecycle {
       this.state = to;
       res = true;
     }
-    LOG.info("tryToMoveTo from {} to {} => {}", currentState, to, res);
+    LOG.trace("tryToMoveTo from {} to {} => {}", currentState, to, res);
     return res;
   }