| 12 | * Interface for objects where objects in this package's logs can be sent (can be used as `logger` option). |
| 13 | */ |
| 14 | export interface Logger { |
| 15 | /** |
| 16 | * Output debug message |
| 17 | * |
| 18 | * @param msg any data to log |
| 19 | */ |
| 20 | debug(...msg: any[]): void; |
| 21 | |
| 22 | /** |
| 23 | * Output info message |
| 24 | * |
| 25 | * @param msg any data to log |
| 26 | */ |
| 27 | info(...msg: any[]): void; |
| 28 | |
| 29 | /** |
| 30 | * Output warn message |
| 31 | * |
| 32 | * @param msg any data to log |
| 33 | */ |
| 34 | warn(...msg: any[]): void; |
| 35 | |
| 36 | /** |
| 37 | * Output error message |
| 38 | * |
| 39 | * @param msg any data to log |
| 40 | */ |
| 41 | error(...msg: any[]): void; |
| 42 | |
| 43 | /** |
| 44 | * This disables all logging below the given level, so that after a log.setLevel("warn") call log.warn("something") |
| 45 | * or log.error("something") will output messages, but log.info("something") will not. |
| 46 | * |
| 47 | * @param level as a string, like 'error' (case-insensitive) |
| 48 | */ |
| 49 | setLevel(level: LogLevel): void; |
| 50 | |
| 51 | /** |
| 52 | * This allows the instance to be named so that they can easily be filtered when many loggers are sending output |
| 53 | * to the same destination. |
| 54 | * |
| 55 | * @param name as a string, will be output with every log after the level |
| 56 | */ |
| 57 | setName(name: string): void; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Default logger which logs to stdout and stderr |
no outgoing calls
no test coverage detected