feat: Refine logging levels (#985)
The logging is sometimes too verbose and uses inappropriate level. With this change there should be less disturbing logs and less duplication. Notable changes: * `LifeCycleInitializer#handleException` - duplicated log, already handled in transports that use the initializer. * `McpClientSession#sendRequest` - an MCP protocol level error in JSON-RPC is not really a reason for ERROR level log. Using INFO with more details. * `DefaultJsonSchemaValidator` - ERROR logs in `validate` are always logged by the users of this method. `validateSchema` surfaces as `IllegalArgumentException` and can be logged at higher levels by the user. Also: remove DEBUG logs from mcp-test module. Signed-off-by: Dariusz Jędrzejczyk <2554306+chemicL@users.noreply.github.com>
This commit is contained in:
parent
c6d365c418
commit
c8ab3411b9
1 changed files with 70 additions and 33 deletions
|
|
@ -84,11 +84,9 @@ public class DefaultJsonSchemaValidator implements JsonSchemaValidator {
|
|||
|
||||
}
|
||||
catch (JsonProcessingException e) {
|
||||
logger.error("Failed to validate CallToolResult: Error parsing schema: {}", e);
|
||||
return ValidationResponse.asInvalid("Error parsing tool JSON Schema: " + e.getMessage());
|
||||
}
|
||||
catch (Exception e) {
|
||||
logger.error("Failed to validate CallToolResult: Unexpected error: {}", e);
|
||||
return ValidationResponse.asInvalid("Unexpected validation error: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
@ -113,7 +111,6 @@ public class DefaultJsonSchemaValidator implements JsonSchemaValidator {
|
|||
return ValidationResponse.asValid(null);
|
||||
}
|
||||
catch (Exception e) {
|
||||
logger.error("Failed to validate schema definition: {}", e.getMessage());
|
||||
return ValidationResponse.asInvalid("Failed to validate schema definition: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue