mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Migrate to Flogger (green)
This is a 'green' Flogger migration CL. Green CLs are intended to be as safe as possible and should be easy to review and submit. No changes should be necessary to the code itself prior to submission, but small changes to BUILD files may be required. Changes within files are completely independent of each other, so this CL can be safely split up for review using tools such as Rosie. For more information, see [] Base CL: 197826149 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=198560170
This commit is contained in:
parent
0d2fb3a8f0
commit
70b13596e4
178 changed files with 984 additions and 988 deletions
|
@ -19,7 +19,7 @@ import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
|
|||
|
||||
import com.google.appengine.api.datastore.DatastoreService;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.logging.FormattingLogger;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import google.registry.batch.MapreduceEntityCleanupUtil.EligibleJobResults;
|
||||
import google.registry.mapreduce.MapreduceRunner;
|
||||
import google.registry.request.Action;
|
||||
|
@ -88,7 +88,7 @@ public class MapreduceEntityCleanupAction implements Runnable {
|
|||
private static final String ERROR_NON_POSITIVE_JOBS_TO_DELETE =
|
||||
"Do not specify a non-positive integer for the number of jobs to delete";
|
||||
|
||||
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
private final Optional<String> jobId;
|
||||
private final Optional<String> jobName;
|
||||
|
@ -133,7 +133,7 @@ public class MapreduceEntityCleanupAction implements Runnable {
|
|||
}
|
||||
|
||||
private void handleBadRequest(String message) {
|
||||
logger.severe(message);
|
||||
logger.atSevere().log(message);
|
||||
response.setPayload(message);
|
||||
response.setStatus(SC_BAD_REQUEST);
|
||||
}
|
||||
|
@ -198,12 +198,12 @@ public class MapreduceEntityCleanupAction implements Runnable {
|
|||
&& (!numJobsToDelete.isPresent() || (numJobsProcessed < numJobsToDelete.get())));
|
||||
|
||||
if (numJobsProcessed == 0) {
|
||||
logger.infofmt(
|
||||
"No eligible jobs found with name '%s' older than %s days old.",
|
||||
logger.atInfo().log(
|
||||
"No eligible jobs found with name '%s' older than %d days old.",
|
||||
jobName.orElse("(any)"), defaultedDaysOld);
|
||||
payload.append("No eligible jobs found");
|
||||
} else {
|
||||
logger.infofmt("A total of %s job(s) processed.", numJobsProcessed);
|
||||
logger.atInfo().log("A total of %d job(s) processed.", numJobsProcessed);
|
||||
payload.append(String.format("A total of %d job(s) processed", numJobsProcessed));
|
||||
}
|
||||
response.setPayload(payload.toString());
|
||||
|
@ -219,16 +219,15 @@ public class MapreduceEntityCleanupAction implements Runnable {
|
|||
if (error.isPresent()) {
|
||||
errorCount++;
|
||||
}
|
||||
logger.infofmt("%s: %s", actualJobId, error.orElse("deletion requested"));
|
||||
logger.atInfo().log("%s: %s", actualJobId, error.orElse("deletion requested"));
|
||||
payloadChunkBuilder.ifPresent(
|
||||
stringBuilder ->
|
||||
stringBuilder.append(
|
||||
String.format("%s: %s\n", actualJobId, error.orElse("deletion requested"))));
|
||||
}
|
||||
logger.infofmt(
|
||||
"successfully requested async deletion of %s job(s); errors received on %s",
|
||||
actualJobIds.size() - errorCount,
|
||||
errorCount);
|
||||
logger.atInfo().log(
|
||||
"successfully requested async deletion of %d job(s); errors received on %d",
|
||||
actualJobIds.size() - errorCount, errorCount);
|
||||
if (payloadChunkBuilder.isPresent()) {
|
||||
payloadChunkBuilder.get().append(String.format(
|
||||
"successfully requested async deletion of %d job(s); errors received on %d\n",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue