export type LogLevel = 'info' | 'warn' | 'error' | 'debug';

export interface LogPayload {
  level: LogLevel;
  message: string;
  timestamp: string;
  service: string;
  error?: string;
  stack?: string;
  [key: string]: unknown;
}

export interface LoggerConfig {
  /** Service name included in every log entry (e.g. "admin-dashboard", "billing-service") */
  service: string;
  /** Override NODE_ENV detection for dev/prod mode. Default: reads process.env.NODE_ENV */
  isDev?: boolean;
}

export interface Logger {
  error(message: string, error?: unknown, extra?: Record<string, unknown>): void;
  warn(message: string, extra?: Record<string, unknown>): void;
  info(message: string, extra?: Record<string, unknown>): void;
  debug(message: string, extra?: Record<string, unknown>): void;
}
