-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
metalog.d.ts
46 lines (43 loc) · 1.13 KB
/
metalog.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { EventEmitter } from 'node:events';
interface LoggerOptions {
path: string;
home: string;
workerId?: number;
createStream?: () => NodeJS.WritableStream;
writeInterval: number;
writeBuffer: number;
keepDays: number;
json?: boolean;
toFile?: Array<string>;
toStdout?: Array<string>;
}
export class Logger extends EventEmitter {
active: boolean;
path: string;
workerId: string;
createStream: () => NodeJS.WritableStream;
writeInterval: number;
writeBuffer: number;
keepDays: number;
home: string;
stream: NodeJS.WritableStream;
reopenTimer: NodeJS.Timer;
flushTimer: NodeJS.Timer;
lock: boolean;
buffer: Array<Buffer>;
bufferLength: number;
file: string;
toFile: Record<string, boolean>;
fsEnabled: boolean;
toStdout: Record<string, boolean>;
console: Console;
constructor(args: LoggerOptions);
createLogDir(): Promise<void>;
open(): Promise<Logger>;
close(): Promise<void>;
rotate(): Promise<void>;
write(type: string, s: string): void;
flush(callback: Function): void;
normalizeStack(stack: string): string;
}
export function openLog(args: LoggerOptions): Promise<Logger>;