refactor: replace string concatenation with {} placeholders in log statements

Signed-off-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com>
This commit is contained in:
Sun Yuhan 2025-07-10 20:14:43 +08:00 • committed by Christian Tzolov
commit d282d40a38
2 changed files with 3 additions and 3 deletions

View file

@ -269,7 +269,7 @@ public class StdioClientTransport implements McpClientTransport {
} }
catch (Exception e) { catch (Exception e) {
if (!isClosing) { if (!isClosing) {
logger.error("Error processing inbound message for line: " + line, e); logger.error("Error processing inbound message for line: {}", line, e);
} }
break; break;
} }
@ -366,7 +366,7 @@ public class StdioClientTransport implements McpClientTransport {
} }
})).doOnNext(process -> { })).doOnNext(process -> {
if (process.exitValue() != 0) { if (process.exitValue() != 0) {
logger.warn("Process terminated with code " + process.exitValue()); logger.warn("Process terminated with code {}", process.exitValue());
} }
else { else {
logger.info("MCP server process stopped"); logger.info("MCP server process stopped");

View file

@ -47,7 +47,7 @@ class McpClientSessionTests {
void setUp() { void setUp() {
transport = new MockMcpClientTransport(); transport = new MockMcpClientTransport();
session = new McpClientSession(TIMEOUT, transport, Map.of(), session = new McpClientSession(TIMEOUT, transport, Map.of(),
Map.of(TEST_NOTIFICATION, params -> Mono.fromRunnable(() -> logger.info("Status update: " + params)))); Map.of(TEST_NOTIFICATION, params -> Mono.fromRunnable(() -> logger.info("Status update: {}", params))));
} }
@AfterEach @AfterEach