Skip to content

Commit

Permalink
Fix log messages which are not format strings
Browse files Browse the repository at this point in the history
See also: 2ec0529

This is currently not enforced in Error Prone because it requires
annotating more methods in `airlift:log` with `@FormatMethod`, but
that's hard to do, because it will change their semantics.
  • Loading branch information
ksobolew authored and raunaqmorarka committed Feb 10, 2023
1 parent 513974c commit 93becc1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ private Optional<JWTClaimsSet> queryUserInfo(String accessToken)
try {
UserInfoResponse response = httpClient.execute(new UserInfoRequest(userinfoUrl.get(), new BearerAccessToken(accessToken)), UserInfoResponse::parse);
if (!response.indicatesSuccess()) {
LOG.error("Received bad response from userinfo endpoint: " + response.toErrorResponse().getErrorObject());
LOG.error("Received bad response from userinfo endpoint: %s", response.toErrorResponse().getErrorObject());
return Optional.empty();
}
return Optional.of(response.toSuccessResponse().getUserInfo().toJWTClaimsSet());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ private AWSCredentialsProvider createAwsCredentialsProvider(URI uri, Configurati
region = regionProviderChain.getRegion();
}
catch (SdkClientException ex) {
log.warn("Falling back to default AWS region " + US_EAST_1);
log.warn("Falling back to default AWS region %s", US_EAST_1);
region = US_EAST_1.getName();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,7 @@ public void executeRemoveOrphanFiles(ConnectorSession session, IcebergTableExecu
IcebergSessionProperties.REMOVE_ORPHAN_FILES_MIN_RETENTION);

if (table.currentSnapshot() == null) {
log.debug("Skipping remove_orphan_files procedure for empty table " + table);
log.debug("Skipping remove_orphan_files procedure for empty table %s", table);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public void testView()
catalog.dropNamespace(SESSION, namespace);
}
catch (Exception e) {
LOG.warn("Failed to clean up namespace: " + namespace);
LOG.warn("Failed to clean up namespace: %s", namespace);
}
}
}
Expand Down

0 comments on commit 93becc1

Please sign in to comment.