Migrate all remaining classes to Flogger
This is the next part of the migration to Flogger. This change migrates all remaining classes Flogger. This means all classes in Gerrit core now use Flogger. During this migration we try to make the log statements more consistent: - avoid string concatenation - avoid usage of String.format(...) The visibility of the slf4j library is restricted to plugins and jgit now. This avoids that we accidentally add new dependencies to slf4j. Change-Id: Ide573327315a15cde69b68b5f27934deeb790d37 Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -8,8 +8,8 @@ java_library(
|
||||
"//java/com/google/gerrit/reviewdb:server",
|
||||
"//java/com/google/gerrit/server",
|
||||
"//lib:gwtorm",
|
||||
"//lib/flogger:api",
|
||||
"//lib/jgit/org.eclipse.jgit:jgit",
|
||||
"//lib/log:api",
|
||||
"//lib/prolog:runtime",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
package gerrit;
|
||||
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import com.google.gerrit.reviewdb.client.Account;
|
||||
import com.google.gerrit.reviewdb.client.PatchSet;
|
||||
import com.google.gerrit.server.rules.StoredValues;
|
||||
@@ -25,11 +26,9 @@ import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.StructureTerm;
|
||||
import com.googlecode.prolog_cafe.lang.SymbolTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class PRED_uploader_1 extends Predicate.P1 {
|
||||
private static final Logger log = LoggerFactory.getLogger(PRED_uploader_1.class);
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
private static final SymbolTerm user = SymbolTerm.intern("user", 1);
|
||||
|
||||
@@ -45,9 +44,11 @@ public class PRED_uploader_1 extends Predicate.P1 {
|
||||
|
||||
PatchSet patchSet = StoredValues.getPatchSet(engine);
|
||||
if (patchSet == null) {
|
||||
log.error(
|
||||
"Failed to load current patch set of change "
|
||||
+ StoredValues.getChange(engine).getChangeId());
|
||||
logger
|
||||
.atSevere()
|
||||
.log(
|
||||
"Failed to load current patch set of change %s",
|
||||
StoredValues.getChange(engine).getChangeId());
|
||||
return engine.fail();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user