UNPKG

@200systems/mf-logger

Version:

Structured logging with multiple outputs and performance timing for TypeScript applications

45 lines 1.37 kB
export interface FileHandler { write(content: string): Promise<void>; initialize(): Promise<void>; rotate?(): Promise<void>; } export interface FileConfig { filePath: string; maxSize?: number; maxFiles?: number; } export declare class NodeFileHandler implements FileHandler { private readonly config; private currentFileSize; private fileIndex; private initialized; constructor(config: FileConfig); initialize(): Promise<void>; write(content: string): Promise<void>; rotate(): Promise<void>; private getCurrentFilePath; private getFilePathForIndex; } export declare class BrowserStorageHandler implements FileHandler { private readonly storageKey; private readonly maxEntries; private readonly storage; constructor(config: FileConfig); initialize(): Promise<void>; write(content: string): Promise<void>; private getLogs; retrieveLogs(): Array<{ timestamp: string; content: string; }>; clearLogs(): void; } export declare class NoOpFileHandler implements FileHandler { private readonly config; private warned; constructor(config: FileConfig); initialize(): Promise<void>; write(content: string): Promise<void>; } export declare function createFileHandler(config: FileConfig): FileHandler; //# sourceMappingURL=file-handlers.d.ts.map