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
@@ -27,6 +27,7 @@ import {
isFunctionCall,
isFunctionResponse,
} from '../../utils/messageInspectors.js';
import { debugLogger } from '../../utils/debugLogger.js';
const CLASSIFIER_GENERATION_CONFIG: GenerateContentConfig = {
temperature: 0,
@@ -153,7 +154,7 @@ export class ClassifierStrategy implements RoutingStrategy {
promptId = `classifier-router-fallback-${Date.now()}-${Math.random()
.toString(16)
.slice(2)}`;
console.warn(
debugLogger.warn(
`Could not find promptId in context. This is unexpected. Using a fallback ID: ${promptId}`,
);
}
@@ -206,7 +207,7 @@ export class ClassifierStrategy implements RoutingStrategy {
} catch (error) {
// If the classifier fails for any reason (API error, parsing error, etc.),
// we log it and return null to allow the composite strategy to proceed.
console.warn(`[Routing] ClassifierStrategy failed:`, error);
debugLogger.warn(`[Routing] ClassifierStrategy failed:`, error);
return null;
}
}