/** * App-level lifecycle: `initLogger` on layer construction, `drain.flush()` * when the layer's scope closes (process shutdown for `Layer.launch` / * `runMain`-style programs). */ import { Effect } from "effect"; import * as Layer from "effect/Layer"; import type { LoggerConfig } from "evlog"; /** Anything with an async `flush` — matches evlog's `PipelineDrainFn`. */ export interface Flushable { readonly flush: () => Promise; } /** Flush a drain pipeline, swallowing flush errors (shutdown path). */ export declare const flush: (drain: Flushable) => Effect.Effect; /** * Initialize evlog globally and, if the configured drain exposes `flush` * (evlog's `createDrainPipeline` does), flush buffered events when the * layer's scope closes. * * ```ts * import type { DrainContext } from "evlog" * import { createAxiomDrain } from "evlog/axiom" * import { createDrainPipeline } from "evlog/pipeline" * * const drain = createDrainPipeline({ batch: { size: 50 } })( * createAxiomDrain() * ) * * const EvlogLive = EvlogInit.layer({ * env: { service: "checkout", environment: "production" }, * drain * }) * ``` */ export declare const layer: (config?: LoggerConfig) => Layer.Layer; //# sourceMappingURL=Init.d.ts.map