// Ownership: src/observability/logger/ is owned by Phase 1 sub-plan 1G-logger.
// This type-only seed exists because Phase 1A-1's HostContract depends on Logger.
// Sub-plan 1G-logger extends this file with runtime transports.

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

export type LogFields = Record<string, string | number | boolean | null | undefined>;

export interface Logger {
  debug(msg: string, fields?: LogFields): void;
  info(msg: string, fields?: LogFields): void;
  warn(msg: string, fields?: LogFields): void;
  error(msg: string, fields?: LogFields & { err?: Error }): void;
  child(context: LogFields): Logger;
}

export interface LogRecord {
  ts: string;
  level: LogLevel;
  msg: string;
  fields: LogFields;
}

export interface LogTransport {
  write(record: LogRecord): void;
  flush(): Promise<void>;
}
