]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6997 less confusing of type key paar in logs
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 4 Dec 2015 11:18:28 +0000 (12:18 +0100)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 4 Dec 2015 11:18:28 +0000 (12:18 +0100)
server/sonar-server/src/main/java/org/sonar/server/computation/component/DepthTraversalTypeAwareCrawler.java
server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareCrawler.java
server/sonar-server/src/main/java/org/sonar/server/computation/component/VisitorsCrawler.java

index 2882a03a93b323cdacbaa83cf2efa9d3a044b845..9bb6092c181c069635312ac3ccd4c2cfb5a41929 100644 (file)
@@ -39,7 +39,7 @@ public final class DepthTraversalTypeAwareCrawler implements ComponentCrawler {
     try {
       visitImpl(component);
     } catch (RuntimeException e) {
-      VisitException.rethrowOrWrap(e, "Visit of Component %s:%s failed", component.getType(), component.getKey());
+      VisitException.rethrowOrWrap(e, "Visit of Component {key=%s,type=%s} failed", component.getKey(), component.getType());
     }
   }
 
index 5c92e471a1996598f563fd1517deadecdcd5f57c..ebb0277de59c7efb0b6be4b97cb8b700335f1e2f 100644 (file)
@@ -51,8 +51,8 @@ public final class PathAwareCrawler<T> implements ComponentCrawler {
     } catch (RuntimeException e) {
       VisitException.rethrowOrWrap(
         e,
-        "Visit failed for Component %s:%s%s",
-        component.getType(), component.getKey(), new ComponentPathPrinter<>(stack));
+        "Visit failed for Component {key=%s,type=%s} %s",
+        component.getKey(), component.getType(), new ComponentPathPrinter<>(stack));
     }
   }
 
@@ -174,7 +174,7 @@ public final class PathAwareCrawler<T> implements ComponentCrawler {
       @Override
       @Nonnull
       public String apply(@Nonnull PathAwareVisitor.PathElement<?> input) {
-        return format("%s:%s", input.getComponent().getType(), input.getComponent().getKey());
+        return format("%s(type=%s)", input.getComponent().getKey(), input.getComponent().getType());
       }
     }
   }
index 52ded7e54d60cc08ccb2ee7df4f9198d5671aefe..f684d8e85fbeaae6d400970459875f0833933f8b 100644 (file)
@@ -64,9 +64,8 @@ public class VisitorsCrawler implements ComponentCrawler {
     } catch (RuntimeException e) {
       VisitException.rethrowOrWrap(
         e,
-        "Visit of Component %s:" +
-            "%s failed",
-        component.getType(), component.getKey());
+        "Visit of Component {key=%s,type=%s} failed",
+        component.getKey(), component.getType());
     }
   }