import { i as Logger$1, r as LogLevel } from "./logger-CxGXigv1.mjs"; import { TransportMultiOptions, TransportSingleOptions } from "pino"; //#region src/logger/transports.d.ts /** Axiom credentials. The token comes from env vars or the OS keyring — never * a committed config file; the dataset name may come from config. */ interface AxiomTransportConfig { dataset: string; token: string; } interface BuildTransportInput { /** Resolved log level — applied uniformly to every transport. */ level: LogLevel; /** Axiom credentials. When absent, no Axiom transport is wired. */ axiom?: AxiomTransportConfig; /** `true` inside CI — suppresses pino-pretty. */ ci: boolean; /** `process.stdout.isTTY` — pino-pretty only makes sense on a TTY. */ tty: boolean; /** `true` when `HOLOCRON_TELEMETRY=false` — suppresses the Axiom transport only. */ telemetryDisabled: boolean; /** * Explicit override for whether human-visible console output (pretty or * NDJSON) runs at all, independent of `level`. `undefined` (default) * preserves the existing `ci`/`tty` auto-detection below. `false` * suppresses console output entirely, regardless of `ci`/`tty` — Axiom * (if configured) is unaffected. When nothing else is wired either, * {@link createPinoInstance} routes to a null destination instead of * falling back to Pino's own default stdout — see its doc for why that * distinction matters. */ consoleOutput?: boolean; } /** * Build the Pino `transport` option for the current environment. * * | Environment | Output | * | -------------------------- | --------------------------------------------------- | * | Local, TTY, no Axiom | `pino-pretty` only | * | CI, no Axiom | `undefined` — Pino's default NDJSON to stdout | * | Local, TTY, with Axiom | `pino-pretty` + Axiom | * | CI, with Axiom | NDJSON to stdout + Axiom | * | `consoleOutput: false`, no Axiom | `undefined` — routed to a null destination | * | `consoleOutput: false`, with Axiom | Axiom only | * * The Axiom transport is dropped entirely when `telemetryDisabled` is set, * regardless of whether credentials were supplied. Every transport runs on * the same resolved `level` — there is no Axiom-only gate. * * Returning `undefined` lets `createLogger` fall back to a plain * `pino({ ... })` with no worker thread — the cheapest path, and exactly * what CI wants. * * `consoleOutput: false` opts out of all of the above: no pretty, no NDJSON, * regardless of `ci`/`tty`. Axiom (when configured) still gets its own * target, untouched by the override. */ declare function buildTransport(input: BuildTransportInput): TransportSingleOptions | TransportMultiOptions | undefined; //#endregion //#region src/logger/create.d.ts interface LoggerConfig { /** * Explicit level — the highest-priority source. The caller passes the * resolved `--verbose` / `--quiet` flag or a config field here. Falls * through to `HOLOCRON_LOG_LEVEL`, then `"info"`. */ level?: LogLevel; /** * Axiom credentials. Resolved from env vars by default * (`HOLOCRON_AXIOM_TOKEN` / `AXIOM_TOKEN` + `HOLOCRON_AXIOM_DATASET` / * `AXIOM_DATASET`). Pass this only to override — e.g. to pair an OS-keyring * token with a config-file dataset. The **token** must never come from a * committed config file. The transport is also skipped entirely when * `HOLOCRON_TELEMETRY=false`. */ axiom?: AxiomTransportConfig; /** * Explicit override for whether human-visible console output (pretty or * NDJSON) runs at all, independent of `level`. `undefined` (default) * preserves the existing `ci`/`tty` auto-detection — every consumer that * doesn't pass this is unaffected. Pass `false` to suppress console * output entirely (e.g. a CLI's quiet-by-default interactive mode); * Axiom (if configured) still receives everything. */ consoleOutput?: boolean; } interface CreateLoggerResult { /** The logger to thread through modules via `child()`. */ logger: Logger$1; /** * Correlation id bound to every line this logger (and its children) emit. * Surface it to the user (e.g. on `--debug`) so they can pull the run out * of Axiom. */ runId: string; } /** * The single entry point for building a Pino-backed logger. Generates a * `runId`, detects the environment, resolves the level, wires the right * transports, and returns a ready {@link Logger}. * * ```ts * const { logger, runId } = createLogger({ level, axiom }); * const log = logger.child({ command: "sync-github", repo }); * log.info({ branch }, "opening PR"); * ``` * * For a browser / edge / React Native context, construct a `ConsoleLogger` * directly instead — it needs no `createLogger`. */ declare function createLogger(config?: LoggerConfig): CreateLoggerResult; //#endregion export { BuildTransportInput as a, AxiomTransportConfig as i, LoggerConfig as n, buildTransport as o, createLogger as r, CreateLoggerResult as t };