import type { ILogger } from './types.js';

export class ConsoleLogger implements ILogger {
  public log(levelArg: 'debug' | 'info' | 'warn' | 'error', messageArg: string, metadataArg?: Record<string, unknown>): void {
    const payload = metadataArg ? ` ${JSON.stringify(metadataArg)}` : '';
    console[levelArg === 'debug' ? 'log' : levelArg](`[${levelArg}] ${messageArg}${payload}`);
  }
}
