mirror of
https://github.com/google/nomulus
synced 2026-08-01 04:46:08 +00:00
Migrate to flogger (red)
This is a 'red' Flogger migration CL. Red CLs contain changes which are likely not to work without manual intervention. Note that it may not even be possible to directly migrate the logger usage in this CL to the Flogger API and some additional refactoring may be required. If this is the case, please note that it should be safe to submit any outstanding 'green' and 'yellow' CLs prior to tackling this. If you feel that your use case is not covered by the existing Flogger API please raise a feature request at []and revert this CL. For more information, see [] Base CL: 197826149 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=198463651
This commit is contained in:
@@ -32,6 +32,8 @@ java_library(
|
||||
"@com_google_auto_value",
|
||||
"@com_google_code_findbugs_jsr305",
|
||||
"@com_google_dagger",
|
||||
"@com_google_flogger",
|
||||
"@com_google_flogger_system_backend",
|
||||
"@com_google_guava",
|
||||
"@com_google_re2j",
|
||||
"@javax_servlet_api",
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.ImmutableSetMultimap;
|
||||
import com.google.common.collect.Multimaps;
|
||||
import com.google.common.logging.FormattingLogger;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import google.registry.config.RegistryConfig.Config;
|
||||
import google.registry.mapreduce.MapreduceRunner;
|
||||
import google.registry.mapreduce.inputs.EppResourceInputs;
|
||||
@@ -194,7 +194,7 @@ public final class RdeStagingAction implements Runnable {
|
||||
|
||||
public static final String PATH = "/_dr/task/rdeStaging";
|
||||
|
||||
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@Inject Clock clock;
|
||||
@Inject PendingDepositChecker pendingDepositChecker;
|
||||
@@ -218,12 +218,14 @@ public final class RdeStagingAction implements Runnable {
|
||||
manual ? getManualPendingDeposits() : getStandardPendingDeposits();
|
||||
if (pendings.isEmpty()) {
|
||||
String message = "Nothing needs to be deposited";
|
||||
logger.info(message);
|
||||
logger.atInfo().log(message);
|
||||
response.setStatus(SC_NO_CONTENT);
|
||||
response.setPayload(message);
|
||||
return;
|
||||
}
|
||||
pendings.values().stream().map(Object::toString).forEach(logger::info);
|
||||
for (PendingDeposit pending : pendings.values()) {
|
||||
logger.atInfo().log("Pending deposit: %s", pending);
|
||||
}
|
||||
RdeStagingMapper mapper = new RdeStagingMapper(lenient ? LENIENT : STRICT, pendings);
|
||||
|
||||
response.sendJavaScriptRedirect(createJobPath(mrRunner
|
||||
@@ -261,7 +263,8 @@ public final class RdeStagingAction implements Runnable {
|
||||
pendingDepositChecker.getTldsAndWatermarksPendingDepositForRdeAndBrda(),
|
||||
pending -> {
|
||||
if (clock.nowUtc().isBefore(pending.watermark().plus(transactionCooldown))) {
|
||||
logger.infofmt("Ignoring within %s cooldown: %s", transactionCooldown, pending);
|
||||
logger.atInfo().log(
|
||||
"Ignoring within %s cooldown: %s", transactionCooldown, pending);
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user