Skip to content
This repository was archived by the owner on Jul 13, 2026. It is now read-only.

Commit 3698df7

Browse files
author
Theo van Kraay
committed
tidy up logging
1 parent 96f49ec commit 3698df7

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

src/main/java/com/azure/cosmos/examples/containercrud/async/ContainerCRUDQuickstartAsync.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,7 @@ private void readAllContainers() throws Exception {
141141
// Print
142142
String msg="Listing containers in database:\n";
143143
containers.byPage(100).flatMap(readAllContainersResponse -> {
144-
logger.info("read " +
145-
readAllContainersResponse.getResults().size() + " containers(s)"
146-
+ " with request charge of " + readAllContainersResponse.getRequestCharge());
144+
logger.info("read {} containers(s) with request charge of {}", readAllContainersResponse.getResults().size(),readAllContainersResponse.getRequestCharge());
147145

148146
for (CosmosContainerProperties response : readAllContainersResponse.getResults()) {
149147
logger.info("container id: {}", response.getId());
@@ -207,7 +205,7 @@ private void createContainerIfNotExistsLWWDefaultTimestamp() throws Exception {
207205
// Multi-master only: Container create: last-writer-wins conflict resolution
208206
// Favor the newest write, using one of the document fields as a custom timestamp
209207
private void createContainerIfNotExistsLWWCustomTimestamp() throws Exception {
210-
logger.info("Create container " + containerName + " if not exists.");
208+
logger.info("Create container {} if not exists.", containerName);
211209

212210
// Create container properties structure
213211
CosmosContainerProperties containerProperties =

src/main/java/com/azure/cosmos/examples/databasecrud/async/DatabaseCRUDQuickstartAsync.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static void main(String[] args) {
5959

6060
private void databaseCRUDDemo() throws Exception {
6161

62-
logger.info("Using Azure Cosmos DB endpoint: " + AccountSettings.HOST);
62+
logger.info("Using Azure Cosmos DB endpoint: {}", AccountSettings.HOST);
6363

6464
// Create async client
6565
client = new CosmosClientBuilder()
@@ -112,7 +112,7 @@ private void readAllDatabases() throws Exception {
112112
logger.info("read {} database(s) with request charge of {}", readAllDatabasesResponse.getResults().size(),readAllDatabasesResponse.getRequestCharge());
113113

114114
for (CosmosDatabaseProperties response : readAllDatabasesResponse.getResults()) {
115-
logger.info("database id: "+response.getId());
115+
logger.info("database id: {}", response.getId());
116116
//Got a page of query result with
117117
}
118118
return Flux.empty();

0 commit comments

Comments
 (0)