use debugLogger instead of console (#12095)

This commit is contained in:
Tommaso Sciortino
2025-10-27 11:35:16 -07:00
committed by GitHub
parent e115083fac
commit 0e4dce23b2
5 changed files with 9 additions and 18 deletions
+4 -3
View File
@@ -15,6 +15,8 @@ import { type Config } from '../config/config.js';
import { DEFAULT_FILE_FILTERING_OPTIONS } from '../config/constants.js';
import { ToolErrorType } from './tool-error.js';
import { GLOB_TOOL_NAME } from './tool-names.js';
import { getErrorMessage } from '../utils/errors.js';
import { debugLogger } from '../utils/debugLogger.js';
// Subset of 'Path' interface provided by 'glob' that we can implement for testing
export interface GlobPath {
@@ -238,9 +240,8 @@ class GlobToolInvocation extends BaseToolInvocation<
returnDisplay: `Found ${fileCount} matching file(s)`,
};
} catch (error) {
const errorMessage =
error instanceof Error ? error.message : String(error);
console.error(`GlobLogic execute Error: ${errorMessage}`, error);
debugLogger.warn(`GlobLogic execute Error`, error);
const errorMessage = getErrorMessage(error);
const rawError = `Error during glob search operation: ${errorMessage}`;
return {
llmContent: rawError,