refactor(logging): replace console usage with logger

This commit is contained in:
William Valentin
2025-09-23 12:19:15 -07:00
parent 16bd4a8b20
commit 10d1de91fe
11 changed files with 76 additions and 44 deletions

View File

@@ -1,3 +1,5 @@
import { logger } from '../services/logging';
/**
* Unified Application Configuration System
*
@@ -754,10 +756,10 @@ function validateConfig(config: UnifiedConfig): void {
// Log warnings and throw errors
if (warnings.length > 0) {
console.warn('⚠️ Configuration warnings:', warnings);
logger.warn('Configuration warnings', 'CONFIG', warnings);
}
if (errors.length > 0) {
console.error('Configuration errors:', errors);
logger.error('Configuration errors', 'CONFIG', errors);
throw new Error(`Configuration validation failed: ${errors.join(', ')}`);
}
}
@@ -956,7 +958,7 @@ export function exportAsEnvVars(
*/
export function logConfig(): void {
if (unifiedConfig.features.debugMode) {
console.warn('🔧 Unified Configuration (Single Source of Truth):', {
logger.info('Unified Configuration (Single Source of Truth)', 'CONFIG', {
environment: unifiedConfig.app.environment,
app: unifiedConfig.app.name,
version: unifiedConfig.app.version,