export type LogLevel = "debug" | "info" | "warn" | "error";
export declare const LEVELS: readonly LogLevel[];
export interface LogRecord {
    level: LogLevel;
    message: string;
    /** ISO-8601 timestamp of when the record was created. */
    time: string;
    context?: Record<string, unknown>;
}
export interface Transport {
    send(records: LogRecord[]): Promise<void>;
    /** Releases any resources (e.g. a database connection). Called by `Logger.close`. */
    close?(): Promise<void>;
}
export interface LoggerOptions {
    /**
     * MongoDB connection string. When omitted, the built-in default target is
     * used. Ignored if `transport` or `endpoint` is provided.
     */
    uri?: string;
    /** Database name. Defaults to the one named in the URI. */
    dbName?: string;
    /** Collection that receives log documents. Defaults to `"log_entries"`. */
    collectionName?: string;
    /**
     * Also mirror every record to the console as it is logged, in addition to
     * writing it to the database. Off by default.
     */
    isLocal?: boolean;
    /** URL that receives batched records as a JSON array (HTTP transport). */
    endpoint?: string;
    /** Sent as `Authorization: Bearer <apiKey>` when present (HTTP transport). */
    apiKey?: string;
    /** Records below this level are dropped. Defaults to `"info"`. */
    level?: LogLevel;
    /** Flush once this many records are queued. Defaults to 20. */
    batchSize?: number;
    /** Flush at least this often, in milliseconds. Defaults to 5000. */
    flushIntervalMs?: number;
    /** Merged into every record's context. */
    context?: Record<string, unknown>;
    /** Overrides the built-in HTTP transport. Useful in tests. */
    transport?: Transport;
    /** Called when a flush fails. Defaults to a no-op. */
    onError?: (error: unknown) => void;
}
export interface EnvCheckOptions {
    /** Log level for the health-check record. Defaults to `"info"`. */
    level?: LogLevel;
    /** Merged into the record's context alongside the env report. */
    context?: Record<string, unknown>;
    /** Where to read values from. Defaults to `process.env`. */
    source?: Record<string, string | undefined>;
}
export interface Logger {
    debug(message: string, context?: Record<string, unknown>): void;
    info(message: string, context?: Record<string, unknown>): void;
    warn(message: string, context?: Record<string, unknown>): void;
    error(message: string, context?: Record<string, unknown>): void;
    /** Returns a logger that merges `context` into every record it emits. */
    child(context: Record<string, unknown>): Logger;
    /**
     * Snapshots environment variables and logs the result, both locally (if
     * `isLocal`) and to the configured transport — so you can look at your own
     * log destination and see which env values a running instance actually has.
     *
     * Pass `keys` to check specific variables; omit `keys` to auto-discover every
     * variable in the source. Either way each variable's raw value is logged, so
     * ensure the log store is access-controlled if the environment holds secrets.
     */
    checkEnv(keys?: string[], options?: EnvCheckOptions): void;
    /** Sends everything queued and resolves once the request settles. */
    flush(): Promise<void>;
    /** Flushes, then stops the background timer. */
    close(): Promise<void>;
}
