import { type BootEventName } from '../../constants/telemetry/index.js'; import type { LogRecord } from './types.js'; /** * How a boot record is turned into one readable line. * * The complaint this exists to answer is that the logs say nothing when the * project starts. A record already carries everything — the problem is the * shape it arrives in: an absolute ISO timestamp nobody can subtract in * their head, and every attribute dumped as JSON, so the two facts that * matter sit inside forty that do not. * * Two things fix most of it, and neither is a freebie of a generic sink. * The `+Nms` column turns a wall of timestamps into a readout of which * phase was slow. And a template per event decides which attributes are * worth a line at `info`, instead of printing all of them. * * **Display only.** Nothing here may mutate a record, and no machine-read * path sees any of it — `jsonLinesSink` renders the same records * byte-identically whether or not this file is loaded. */ /** * A template returns the text after the marker, or `undefined` to fall * through to the default rendering. * * It receives the record rather than just the attributes because several * lines are the body with two attributes appended, and re-deriving the body * from attributes would let the rendered line disagree with what the * emitter actually said. */ export type BootTemplate = (record: LogRecord) => string | undefined; /** * One template per boot event, as a TOTAL map over the union. * * `Record` rather than `Partial<…>` on purpose: adding a * member to `BOOT_EVENT_NAMES` then fails to compile here until somebody * decides how it should read. A partial map would let a new event silently * fall through to the default dump, which is the exact outcome this file * exists to prevent — and nothing would fail. */ export declare const BOOT_TEMPLATES: Record; /** * The column label: `namzu.config.resolved` reads as `config`. * * Derived from the event name rather than `scope.name` because the scope of * every one of these is the process that emitted it — `cli` for all eleven — * which would make the column a constant and buy nothing. A record with no * event name keeps its scope, which is the only thing it has. */ export declare function columnLabel(record: LogRecord): string; /** The rendered body for a record, or `undefined` to use the default. */ export declare function applyTemplate(record: LogRecord): string | undefined; /** * FNV-1a, written out rather than imported. * * The requirement is that the same scope gets the same colour in a * different process on a different day, so nothing here may touch process * state — no `Math.random`, no insertion order, no `Date`. Written out * because a dependency could change its algorithm in a patch release and * every colour in every terminal would move at once, for a bump nobody * reviewed as a display change. */ export declare function scopeColour(scope: string): number; //# sourceMappingURL=templates.d.ts.map