UNPKG

1.32 kBTypeScriptView Raw
1/*
2 Copyright © 2018 Andrew Powell
3
4 This Source Code Form is subject to the terms of the Mozilla Public
5 License, v. 2.0. If a copy of the MPL was not distributed with this
6 file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
8 The above copyright notice and this permission notice shall be
9 included in all copies or substantial portions of this Source Code Form.
10*/
11
12export interface MethodFactory {
13 levels?: any[];
14 logger?: LogLevel;
15 methods?: string[];
16
17 bindMethod?: (obj: any, methodName: string) => any;
18 distillLevel?: (level: string | number) => any;
19 levelValid?: (level: string | number) => boolean;
20 make?: (methodName: string) => any;
21 replaceMethods?: (logLevel: string | number) => void;
22}
23
24export interface PrefixFactory extends MethodFactory {
25 interpolate(level: string): string;
26 make(methodName: string): any;
27}
28
29export interface LogLevel {
30 factory: MethodFactory;
31 disable(): void;
32 enable(): void;
33 level: any;
34 levels: any[];
35
36 debug(...args: any[]): void;
37 error(...args: any[]): void;
38 info(...args: any[]): void;
39 trace(...args: any[]): void;
40 warn(...args: any[]): void;
41}
42
43export interface DefaultLogger extends LogLevel {
44 factories: any;
45 loggers: any;
46
47 create(options: any): LogLevel;
48}
49
50declare const instance: DefaultLogger
51
52export default instance