UNPKG

3.78 kBTypeScriptView Raw
1/** @module log */
2import { ILogger } from './ILogger';
3import { LogLevel } from './LogLevel';
4/**
5 * Dummy implementation of logger that doesn't do anything.
6 *
7 * It can be used in testing or in situations when logger is required
8 * but shall be disabled.
9 *
10 * @see [[ILogger]]
11 */
12export declare class NullLogger implements ILogger {
13 /**
14 * Creates a new instance of the logger.
15 */
16 constructor();
17 /**
18 * Gets the maximum log level.
19 * Messages with higher log level are filtered out.
20 *
21 * @returns the maximum log level.
22 */
23 getLevel(): LogLevel;
24 /**
25 * Set the maximum log level.
26 *
27 * @param value a new maximum log level.
28 */
29 setLevel(value: LogLevel): void;
30 /**
31 * Logs a message at specified log level.
32 *
33 * @param level a log level.
34 * @param correlationId (optional) transaction id to trace execution through call chain.
35 * @param error an error object associated with this message.
36 * @param message a human-readable message to log.
37 * @param args arguments to parameterize the message.
38 */
39 log(level: LogLevel, correlationId: string, error: Error, message: string, ...args: any[]): void;
40 /**
41 * Logs fatal (unrecoverable) message that caused the process to crash.
42 *
43 * @param correlationId (optional) transaction id to trace execution through call chain.
44 * @param error an error object associated with this message.
45 * @param message a human-readable message to log.
46 * @param args arguments to parameterize the message.
47 */
48 fatal(correlationId: string, error: Error, message: string, ...args: any[]): void;
49 /**
50 * Logs recoverable application error.
51 *
52 * @param correlationId (optional) transaction id to trace execution through call chain.
53 * @param error an error object associated with this message.
54 * @param message a human-readable message to log.
55 * @param args arguments to parameterize the message.
56 */
57 error(correlationId: string, error: Error, message: string, ...args: any[]): void;
58 /**
59 * Logs a warning that may or may not have a negative impact.
60 *
61 * @param correlationId (optional) transaction id to trace execution through call chain.
62 * @param message a human-readable message to log.
63 * @param args arguments to parameterize the message.
64 */
65 warn(correlationId: string, message: string, ...args: any[]): void;
66 /**
67 * Logs an important information message
68 *
69 * @param correlationId (optional) transaction id to trace execution through call chain.
70 * @param message a human-readable message to log.
71 * @param args arguments to parameterize the message.
72 */
73 info(correlationId: string, message: string, ...args: any[]): void;
74 /**
75 * Logs a high-level debug information for troubleshooting.
76 *
77 * @param correlationId (optional) transaction id to trace execution through call chain.
78 * @param message a human-readable message to log.
79 * @param args arguments to parameterize the message.
80 */
81 debug(correlationId: string, message: string, ...args: any[]): void;
82 /**
83 * Logs a low-level debug information for troubleshooting.
84 *
85 * @param correlationId (optional) transaction id to trace execution through call chain.
86 * @param message a human-readable message to log.
87 * @param args arguments to parameterize the message.
88 */
89 trace(correlationId: string, message: string, ...args: any[]): void;
90}