Skip to content

Commit

Permalink
Avoid string concat for logger (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr authored Aug 9, 2024
1 parent 379537f commit da9717d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class AzureCredentialStorageIntegrationTest {

private boolean checkEnvNullVariables() {
if (Strings.isNullOrEmpty(clientId) || Strings.isNullOrEmpty(clientSecret)) {
LOGGER.debug("Null Azure testing environment variables! Skip " + this.getClass().getName());
LOGGER.debug("Null Azure testing environment variables! Skip {}", this.getClass().getName());
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class GcpCredentialsStorageIntegrationTest {
public void testSubscope(boolean allowedListAction) throws IOException {
if (Strings.isNullOrEmpty(gcsServiceKeyJsonFileLocation)) {
LOGGER.debug(
"Environment variable GOOGLE_APPLICATION_CREDENTIALS not exits, skip test "
+ getClass().getName());
"Environment variable GOOGLE_APPLICATION_CREDENTIALS not exits, skip test {}",
getClass().getName());
return;
}
List<String> allowedRead =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public Catalog createCallContextCatalog(
String catalogFile = Paths.get(realmDir, catalogName).toString();

// Ensure parent directories of metastore-state base directory exists.
LOG.info("Creating metastore state directory: " + realmDir);
LOG.info("Creating metastore state directory: {}", realmDir);
try {
Path result = Files.createDirectories(FileSystems.getDefault().getPath(realmDir));
} catch (IOException ioe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ public void testIcebergDropNamespaceInExternalCatalog(TestInfo testInfo) throws
sessionCatalog.loadNamespaceMetadata(sessionContext, ns);
Assertions.fail("Expected exception when loading namespace after drop");
} catch (NoSuchNamespaceException e) {
LOGGER.info("Received expected exception " + e.getMessage());
LOGGER.info("Received expected exception {}", e.getMessage());
}
}
}
Expand All @@ -446,7 +446,7 @@ public void testIcebergCreateTablesInExternalCatalog(TestInfo testInfo) throws I
.create();
Assertions.fail("Expected failure calling create table in external catalog");
} catch (BadRequestException e) {
LOGGER.info("Received expected exception " + e.getMessage());
LOGGER.info("Received expected exception {}", e.getMessage());
}
}
}
Expand Down Expand Up @@ -497,7 +497,7 @@ public void testIcebergCreateTablesWithWritePathBlocked(TestInfo testInfo) throw
.hasMessage(
"Forbidden: Delegate access to table with user-specified write location is temporarily not supported.");
} catch (BadRequestException e) {
LOGGER.info("Received expected exception " + e.getMessage());
LOGGER.info("Received expected exception {}", e.getMessage());
}
}
}
Expand Down Expand Up @@ -598,7 +598,7 @@ public void testIcebergUpdateTableInExternalCatalog(TestInfo testInfo) throws IO
.commit();
Assertions.fail("Should fail when committing an update to external catalog");
} catch (BadRequestException e) {
LOGGER.info("Received expected exception " + e.getMessage());
LOGGER.info("Received expected exception {}", e.getMessage());
}
}
}
Expand Down Expand Up @@ -646,7 +646,7 @@ public void testIcebergDropTableInExternalCatalog(TestInfo testInfo) throws IOEx
sessionCatalog.loadTable(sessionContext, tableIdentifier);
Assertions.fail("Expected failure loading table after drop");
} catch (NoSuchTableException e) {
LOGGER.info("Received expected exception " + e.getMessage());
LOGGER.info("Received expected exception {}", e.getMessage());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ static PolarisPrincipalSecrets getAdminSecrets() {
if (dropwizardExtensionField == null) {
LoggerFactory.getLogger(PolarisGrantRecord.class)
.warn(
"Unable to find dropwizard extension field in test class "
+ extensionContext.getRequiredTestClass());
"Unable to find dropwizard extension field in test class {}",
extensionContext.getRequiredTestClass());
return null;
}
DropwizardAppExtension appExtension =
Expand Down

0 comments on commit da9717d

Please sign in to comment.