CreateReviewNotes: Use Logger's built-in string formatting
Change-Id: Iffb19f9a9d370dcc0b476421028ec608d715d0df
diff --git a/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/CreateReviewNotes.java b/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/CreateReviewNotes.java
index 69e48ca..504bfba 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/CreateReviewNotes.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/CreateReviewNotes.java
@@ -111,9 +111,9 @@
ProjectState projectState = projectCache.get(project);
if (projectState == null) {
log.error(
- "Could not obtain available labels for project "
- + project.get()
- + ". Expect missing labels in its review notes.");
+ "Could not obtain available labels for project {}."
+ + " Expect missing labels in its review notes.",
+ project.get());
this.labelTypes = new LabelTypes(Collections.<LabelType>emptyList());
} else {
this.labelTypes = projectState.getLabelTypes();
@@ -166,8 +166,11 @@
getMessage().append("* ").append(c.getShortMessage()).append("\n");
}
} else {
- log.debug(
- "no note for this commit since it is a direct push: " + c.getName().substring(0, 7));
+ if (log.isDebugEnabled()) {
+ log.debug(
+ "no note for this commit since it is a direct push {}",
+ c.getName().substring(0, 7));
+ }
}
}
}