-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
53 lines (53 loc) · 1.54 KB
/
index.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
47
48
49
50
51
52
53
import symbols from 'log-symbols';
import winston from 'winston';
import 'winston-daily-rotate-file';
import { ConsoleColors } from './util/console-colors';
export interface LogOptions {
level?: string;
filename?: string;
datePattern?: string;
maxSize?: string;
}
export interface LoggerOptions {
level: string;
silent: boolean;
debugLog: LogOptions | false;
errorLog: LogOptions | false;
customLogs?: LogOptions[];
}
interface LeveledLogMethod {
(message: string): winston.Logger;
(message: string, meta: any): winston.Logger;
(message: string, ...meta: any[]): winston.Logger;
(infoObject: object): winston.Logger;
}
declare class Logger {
private options;
/**
* Internal logger
*/
private logger;
private init;
constructor();
/**
* Configure the logger
* @param {Partial<LoggerOptions>} options The options to configure the logger
*/
config(options: Partial<LoggerOptions>): void;
silly: LeveledLogMethod;
debug: LeveledLogMethod;
verbose: LeveledLogMethod;
db: LeveledLogMethod;
http: LeveledLogMethod;
info: LeveledLogMethod;
warn: LeveledLogMethod;
error: LeveledLogMethod;
success: LeveledLogMethod;
controller: (name: string, fn: string, ...meta: any) => winston.Logger;
middleware: (fn: string, ...meta: any) => winston.Logger;
profile: (id: string | number) => winston.Logger;
startTimer: () => () => winston.Profiler;
}
declare const logger: Logger;
export default logger;
export { ConsoleColors, symbols };