/** * log.ts — File logging for @ericzhaozzz/wechat-channel. * * The extension runs *inside* the pi process, which owns the terminal. A * console.log from here is written straight into the TUI's frame and * corrupts the display, so extension-side logging must go to a file. * The worker is a separate process and logs to its own stderr, which the * extension pipes into this same file (see startWorker). * * Only one process writes the file, so rotation needs no locking. */ export declare const MAX_LOG_BYTES: number; export interface Logger { /** Informational line. */ info(...args: unknown[]): void; /** Something notable that is not a failure (a dropped sender, a retry). */ warn(...args: unknown[]): void; /** Failure line; same destination, marked ERROR. */ error(...args: unknown[]): void; /** Write text that already carries its own formatting (piped stderr). */ raw(text: string): void; /** Absolute path of the file being written. */ readonly file: string; } /** * The last `count` non-empty lines of `text`. * * `/wechat log` could only ever print a path, which means the answer to * "why did that message not come through" lives in a second terminal the * operator has to go open. Pure so the slicing is testable without a file. */ export declare function tailLines(text: string, count: number): string[]; /** * Create a logger appending to `file`. Never throws: logging must not be * able to take down the channel, and there is nowhere to report a logging * failure to anyway. */ export declare function createLogger(file: string, tag: string): Logger; //# sourceMappingURL=log.d.ts.map