Improve some log messages for readability/consistency (#1333)

* Improve some log messages for readability/consistency

* Address code review comments
This commit is contained in:
Ben McIlwain 2021-09-27 11:35:14 -04:00 committed by GitHub
parent 3efb2bc509
commit 703c8edd8c
100 changed files with 252 additions and 250 deletions

View file

@ -68,7 +68,8 @@ public class AppEngineServiceUtilsImpl implements AppEngineServiceUtils {
public String convertToSingleSubdomain(String hostname) {
Matcher matcher = APPSPOT_HOSTNAME_PATTERN.matcher(hostname);
if (!matcher.matches()) {
logger.atWarning().log("Skipping conversion because hostname can't be parsed: %s", hostname);
logger.atWarning().log(
"Skipping conversion because hostname '%s' can't be parsed.", hostname);
return hostname;
}
return matcher.group(1).replace(".", "-dot-") + ".appspot.com";

View file

@ -55,7 +55,7 @@ public class RequestStatusCheckerImpl implements RequestStatusChecker {
public String getLogId() {
String requestLogId =
ApiProxy.getCurrentEnvironment().getAttributes().get(REQUEST_LOG_ID_KEY).toString();
logger.atInfo().log("Current requestLogId: %s", requestLogId);
logger.atInfo().log("Current requestLogId: %s.", requestLogId);
// We want to make sure there actually is a log to query for this request, even if the request
// dies right after this call.
//
@ -85,7 +85,7 @@ public class RequestStatusCheckerImpl implements RequestStatusChecker {
// So we have to assume it's "running" in that case.
if (requestLogs == null) {
logger.atInfo().log(
"Queried an unrecognized requestLogId %s - assume it's running", requestLogId);
"Queried an unrecognized requestLogId %s - assume it's running.", requestLogId);
return true;
}
logger.atInfo().log(

View file

@ -173,6 +173,6 @@ public class Retrier implements Serializable {
private static void reportFailure(Throwable thrown, int failures, int maxAttempts) {
logger.atInfo().withCause(thrown).log(
"Retrying transient error, attempt %d/%d", failures, maxAttempts);
"Retrying transient error, attempt %d/%d.", failures, maxAttempts);
}
}

View file

@ -82,7 +82,7 @@ public class TaskQueueUtils implements Serializable {
() -> {
for (TaskOptions task : tasks) {
logger.atInfo().log(
"Enqueuing queue='%s' endpoint='%s'", queue.getQueueName(), task.getUrl());
"Enqueuing queue='%s' endpoint='%s'.", queue.getQueueName(), task.getUrl());
}
return queue.add(tasks);
},