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
+4 -2
View File
@@ -8,11 +8,13 @@ import * as fs from 'node:fs/promises';
import * as path from 'node:path';
import type { FileDiscoveryService } from '../services/fileDiscoveryService.js';
import type { FileFilteringOptions } from '../config/constants.js';
import { debugLogger } from './debugLogger.js';
// Simple console logger for now.
// TODO: Integrate with a more robust server-side logger.
const logger = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
debug: (...args: any[]) => console.debug('[DEBUG] [BfsFileSearch]', ...args),
debug: (...args: any[]) =>
debugLogger.debug('[DEBUG] [BfsFileSearch]', ...args),
};
interface BfsFileSearchOptions {
@@ -84,7 +86,7 @@ export async function bfsFileSearch(
} catch (error) {
// Warn user that a directory could not be read, as this affects search results.
const message = (error as Error)?.message ?? 'Unknown error';
console.warn(
debugLogger.warn(
`[WARN] Skipping unreadable directory: ${currentDir} (${message})`,
);
if (debug) {