/**
 * JsonLogger — machine-readable NDJSON output.
 *
 * Used with --format json flag. Every log call emits a single JSON
 * line to stdout, suitable for piping to jq, structured log collectors,
 * or programmatic consumption.
 */
export class JsonLogger {
    emit(level, msg, ctx) {
        console.log(JSON.stringify({ level, msg, ts: Date.now(), ...ctx }));
    }
    debug(msg, ctx) {
        this.emit("debug", msg, ctx);
    }
    info(msg, ctx) {
        this.emit("info", msg, ctx);
    }
    warn(msg, ctx) {
        this.emit("warn", msg, ctx);
    }
    error(msg, ctx) {
        this.emit("error", msg, ctx);
    }
    step(name, result) {
        this.emit("step", name, { result });
    }
    section(title) {
        this.emit("section", title);
    }
    table(headers, rows) {
        this.emit("table", "data", { headers, rows });
    }
}
