refactor(logging): Centralize console logging with debugLogger (#11590)

This commit is contained in:
Abhi
2025-10-21 16:35:22 -04:00
committed by GitHub
parent f5e07d94bd
commit b364f37655
72 changed files with 345 additions and 289 deletions
@@ -30,6 +30,7 @@ import {
DEFAULT_GEMINI_MODEL,
DEFAULT_GEMINI_MODEL_AUTO,
DEFAULT_GEMINI_FLASH_MODEL,
debugLogger,
} from '@google/gemini-cli-core';
import * as acp from './acp.js';
import { AcpFileSystemService } from './fileSystemService.js';
@@ -592,7 +593,7 @@ class Session {
const reason = respectGitIgnore
? 'git-ignored and will be skipped'
: 'ignored by custom patterns';
console.warn(`Path ${pathName} is ${reason}.`);
debugLogger.warn(`Path ${pathName} is ${reason}.`);
continue;
}
let currentPathSpec = pathName;
@@ -739,7 +740,7 @@ class Session {
if (pathSpecsToRead.length === 0 && embeddedContext.length === 0) {
// Fallback for lone "@" or completely invalid @-commands resulting in empty initialQueryText
console.warn('No valid file paths found in @ commands to read.');
debugLogger.warn('No valid file paths found in @ commands to read.');
return [{ text: initialQueryText }];
}
@@ -802,7 +803,7 @@ class Session {
}
}
} else {
console.warn(
debugLogger.warn(
'read_many_files tool returned no content or empty content.',
);
}
@@ -855,7 +856,7 @@ class Session {
debug(msg: string) {
if (this.config.getDebugMode()) {
console.warn(msg);
debugLogger.warn(msg);
}
}
}