import { Effect, Ref, type Scope } from "effect"; import { type LogItem, LogLevel, type LogSink } from "./types.js"; /** The console line: `HH:mm:ss.mmm [LEVEL] message`. */ export declare function formatConsoleLine(item: LogItem): string; /** Writes each item to the Effect `Console` service (stdout for debug/info, stderr for warn/error). */ export declare const consoleSink: Effect.Effect; /** Appends each item to `ref`; what `Logger.layerCapture` records. */ export declare function captureSink(ref: Ref.Ref>): LogSink; /** * A sink that only forwards items at or above `level` (on top of the * logger's own threshold). For a noisy channel feeding a quiet display. */ export declare function filterSink(sink: LogSink, predicate: (item: LogItem) => boolean): LogSink; /** `filterSink` by channel: the shape of a toast sink over an "attention" channel. */ export declare function channelSink(sink: LogSink, channel: string): LogSink; /** `filterSink` by minimum level. */ export declare function levelSink(sink: LogSink, level: LogLevel): LogSink; export interface DailyFileSinkOptions { /** Directory of the log files; created on the first write. */ readonly directory: string; /** File name prefix: `/-YYYY-MM-DD.log`. */ readonly prefix: string; /** Files matching the prefix older than this are unlinked on the first write. Default 14; 0 disables. */ readonly retainDays?: number; /** Line format; defaults to `formatFileLine`. Must end without a newline. */ readonly format?: (item: LogItem) => string; } /** * Replaces control bytes so the file stays grep-able text: one NUL flips * BSD grep into binary mode over the whole file. Tabs and newlines pass. */ export declare function sanitizeControl(text: string): string; /** * The file line: ` [] `. * Continuation lines are indented so a multi-line message (a stack trace) * stays readable under `tail -F` without swallowing the next record's * timestamp. */ export declare function formatFileLine(item: LogItem): string; /** * One file per local day (`-YYYY-MM-DD.log`), appended through a * single writer fiber so lines land in order, with retention by mtime on * the first write. Every write is one `appendFile` (O_APPEND), so several * processes can share the file without coordination. A write failure is * reported to the console once per path and never propagates; `flush` * waits for every queued line, and the sink's scope flushes before it * closes. */ export declare const dailyFileSink: (options: DailyFileSinkOptions) => Effect.Effect, never, Scope.Scope>;