class Logger {
  private context: string;

  constructor(context: string) {
    this.context = context;
  }

  private formatMessage(level: string, message: string): string {
    const timestamp = new Date().toISOString();
    return `[${timestamp}] [${level.toUpperCase()}] [${this.context}] ${message}`;
  }

  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
  public debug(message: string, ...args: any[]): void {
    // eslint-disable-next-line no-console
    console.log(this.formatMessage('debug', message), ...args);
  }

  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
  public info(message: string, ...args: any[]): void {
    // eslint-disable-next-line no-console
    console.log(this.formatMessage('info', message), ...args);
  }

  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
  public warn(message: string, ...args: any[]): void {
    // eslint-disable-next-line no-console
    console.warn(this.formatMessage('warn', message), ...args);
  }

  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
  public error(message: string, ...args: any[]): void {
    // eslint-disable-next-line no-console
    console.error(this.formatMessage('error', message), ...args);
  }
}

export function createLogger(context: string): Logger {
  return new Logger(context);
}
