Skip to content

Commit

Permalink
Perform logging properly in QuarkusToolExecutor
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand committed Dec 14, 2023
1 parent d9b008a commit b6a5f8a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ public String execute(ToolExecutionRequest toolExecutionRequest, Object memoryId
Object[] params = prepareArguments(toolExecutionRequest, invokerInstance.methodMetadata());
try {
if (log.isDebugEnabled()) {
log.debugv("Attempting to invoke tool '{0}' with parameters '{1}'", context.tool, Arrays.toString(params));
log.debugv("Attempting to invoke tool {0} with parameters {1}", context.tool, Arrays.toString(params));
}
Object invocationResult = invokerInstance.invoke(context.tool,
params);
String result = handleResult(invokerInstance, invocationResult);
log.debugv("Tool execution result: '{0}'", result);
log.debugv("Tool execution result: {0}", result);
return result;
} catch (Exception e) {
if (e instanceof IllegalArgumentException) {
Expand Down Expand Up @@ -86,9 +86,9 @@ private Object[] prepareArguments(ToolExecutionRequest toolExecutionRequest,
String argumentsJsonStr = toolExecutionRequest.arguments();
Map<String, Object> argumentsFromRequest;
try {
log.debugv("Attempting to convert '{0}' JSON string into args map", argumentsJsonStr);
log.debugv("Attempting to convert {0} JSON string into args map", argumentsJsonStr);
argumentsFromRequest = convertJsonToArguments(argumentsJsonStr);
log.debugv("Converted '{0}' JSON string into args map '{1}'", argumentsJsonStr, argumentsFromRequest);
log.debugv("Converted {0} JSON string into args map {1}", argumentsJsonStr, argumentsFromRequest);
} catch (JsonProcessingException e) {
log.error(e);
invalidMethodParams(argumentsJsonStr);
Expand Down

0 comments on commit b6a5f8a

Please sign in to comment.