UNPKG

aono-file-handler

Version:

Aono handler that write to a log file with support for custom formatters and log rotation.

25 lines (24 loc) 792 B
import { Handler, Entry } from 'aono'; import { Builder } from './Builder'; import { Formatter } from './Formatter'; /** * @author Maciej Chalapuk (maciej@chalapuk.pl) */ export declare class FileHandler implements Handler { readonly prefix: string; readonly formatter: Formatter; readonly rotationBytesThreshold: number; static builder(): Builder; private _bytesWritten; private _currentFile; private _currentFileSize; private _fd; private _format; constructor(prefix: string, formatter?: Formatter, rotationBytesThreshold?: number); get currentFile(): string | null; get currentFileSize(): number | null; get bytesWritten(): number; write(entries: Entry[]): Promise<void>; private _createFilePath; } export default FileHandler;