strogger
Version:
📊 A modern structured logging library with functional programming, duck-typing, and comprehensive third-party integrations
51 lines • 1.52 kB
TypeScript
import { promises as fs } from "node:fs";
import type { Formatter, LogEntry } from "../types";
import { LogLevel } from "../types";
export interface FileTransportOptions {
formatter?: Formatter;
level?: LogLevel;
filePath?: string;
maxFileSize?: number;
maxFiles?: number;
rotationInterval?: number;
compressOldFiles?: boolean;
dateFormat?: string;
encoding?: BufferEncoding;
createSymlink?: boolean;
symlinkName?: string;
}
export interface FileTransportState {
currentFile: string;
currentSize: number;
lastRotation: number;
fileHandle?: fs.FileHandle | undefined;
}
export declare const createFileTransport: (options?: FileTransportOptions) => {
log: (entry: LogEntry) => Promise<void>;
setLevel: (level: LogLevel) => void;
getLevel: () => LogLevel;
rotate: () => Promise<void>;
getCurrentFile: () => string;
getCurrentSize: () => number;
flush: () => Promise<void>;
close: () => Promise<void>;
getConfig: () => {
filePath: string;
maxFileSize: number;
maxFiles: number;
rotationInterval: number;
compressOldFiles: boolean;
dateFormat: string;
encoding: BufferEncoding;
createSymlink: boolean;
symlinkName: string;
};
getStats: () => {
currentFile: string;
currentSize: number;
lastRotation: number;
fileHandleOpen: boolean;
flushTimerActive: boolean;
};
};
//# sourceMappingURL=file-transport.d.ts.map