switched all console logs to logger
This commit is contained in:
parent
3877902ff4
commit
a3f2f199b4
14 changed files with 125 additions and 122 deletions
|
|
@ -3,6 +3,7 @@ import { z } from 'zod';
|
|||
import { EnvLoader } from './loaders/env.loader';
|
||||
import { FileLoader } from './loaders/file.loader';
|
||||
import { ConfigError, ConfigValidationError } from './errors';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
import type {
|
||||
ConfigLoader,
|
||||
ConfigManagerOptions,
|
||||
|
|
@ -12,6 +13,7 @@ import type {
|
|||
} from './types';
|
||||
|
||||
export class ConfigManager<T = Record<string, unknown>> {
|
||||
private readonly logger = getLogger('config-manager');
|
||||
private config: T | null = null;
|
||||
private loaders: ConfigLoader[];
|
||||
private environment: Environment;
|
||||
|
|
@ -81,8 +83,7 @@ export class ConfigManager<T = Record<string, unknown>> {
|
|||
received: (err as any).received,
|
||||
}));
|
||||
|
||||
console.error('Configuration validation failed:');
|
||||
console.error(JSON.stringify(errorDetails, null, 2));
|
||||
this.logger.error('Configuration validation failed:', errorDetails);
|
||||
|
||||
throw new ConfigValidationError('Configuration validation failed', error.errors);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue