mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-29 06:25:16 -07:00
Migrate console to coreEvents.emitFeedback or debugLogger (#15219)
This commit is contained in:
@@ -1159,7 +1159,7 @@ describe('EditTool', () => {
|
||||
result.returnDisplay.diffStat?.model_removed_lines,
|
||||
);
|
||||
} else if (result.error) {
|
||||
console.error(`Edit failed for ${file.path}:`, result.error);
|
||||
throw result.error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -277,9 +277,6 @@ class MemoryToolInvocation extends BaseToolInvocation<
|
||||
} catch (error) {
|
||||
const errorMessage =
|
||||
error instanceof Error ? error.message : String(error);
|
||||
console.warn(
|
||||
`[MemoryTool] Error executing save_memory for fact "${fact}": ${errorMessage}`,
|
||||
);
|
||||
return {
|
||||
llmContent: JSON.stringify({
|
||||
success: false,
|
||||
@@ -367,10 +364,6 @@ export class MemoryTool
|
||||
|
||||
await fsAdapter.writeFile(memoryFilePath, newContent, 'utf-8');
|
||||
} catch (error) {
|
||||
console.error(
|
||||
`[MemoryTool] Error adding memory entry to ${memoryFilePath}:`,
|
||||
error,
|
||||
);
|
||||
throw new Error(
|
||||
`[MemoryTool] Failed to add memory entry: ${error instanceof Error ? error.message : String(error)}`,
|
||||
);
|
||||
|
||||
@@ -729,7 +729,7 @@ describe('SmartEditTool', () => {
|
||||
result.returnDisplay.diffStat?.model_removed_lines,
|
||||
);
|
||||
} else if (result.error) {
|
||||
console.error(`Edit failed for ${file.path}:`, result.error);
|
||||
throw result.error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -416,7 +416,7 @@ export class ToolRegistry {
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(`Tool discovery command "${discoveryCmd}" failed:`, e);
|
||||
debugLogger.error(`Tool discovery command "${discoveryCmd}" failed:`, e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import { ToolErrorType } from './tool-error.js';
|
||||
import { getErrorMessage } from '../utils/errors.js';
|
||||
import { type Config } from '../config/config.js';
|
||||
import { getResponseText } from '../utils/partUtils.js';
|
||||
import { debugLogger } from '../utils/debugLogger.js';
|
||||
|
||||
interface GroundingChunkWeb {
|
||||
uri?: string;
|
||||
@@ -167,7 +168,7 @@ class WebSearchToolInvocation extends BaseToolInvocation<
|
||||
const errorMessage = `Error during web search for query "${
|
||||
this.params.query
|
||||
}": ${getErrorMessage(error)}`;
|
||||
console.error(errorMessage, error);
|
||||
debugLogger.warn(errorMessage, error);
|
||||
return {
|
||||
llmContent: `Error: ${errorMessage}`,
|
||||
returnDisplay: `Error performing web search.`,
|
||||
|
||||
@@ -44,6 +44,7 @@ import { FileOperation } from '../telemetry/metrics.js';
|
||||
import { getSpecificMimeType } from '../utils/fileUtils.js';
|
||||
import { getLanguageFromFilePath } from '../utils/language-detection.js';
|
||||
import type { MessageBus } from '../confirmation-bus/message-bus.js';
|
||||
import { debugLogger } from '../utils/debugLogger.js';
|
||||
|
||||
/**
|
||||
* Parameters for the WriteFile tool
|
||||
@@ -377,7 +378,7 @@ class WriteFileToolInvocation extends BaseToolInvocation<
|
||||
|
||||
// Include stack trace in debug mode for better troubleshooting
|
||||
if (this.config.getDebugMode() && error.stack) {
|
||||
console.error('Write file error stack:', error.stack);
|
||||
debugLogger.error('Write file error stack:', error.stack);
|
||||
}
|
||||
} else if (error instanceof Error) {
|
||||
errorMsg = `Error writing to file: ${error.message}`;
|
||||
|
||||
Reference in New Issue
Block a user