UNPKG

1.36 kBTypeScriptView Raw
1import { ComponentLoggerOptions, DiagLogFunction, DiagLogger, DiagLogLevel } from '../diag/types';
2/**
3 * Singleton object which represents the entry point to the OpenTelemetry internal
4 * diagnostic API
5 */
6export declare class DiagAPI implements DiagLogger {
7 private static _instance?;
8 /** Get the singleton instance of the DiagAPI API */
9 static instance(): DiagAPI;
10 /**
11 * Private internal constructor
12 * @private
13 */
14 private constructor();
15 /**
16 * Set the global DiagLogger and DiagLogLevel.
17 * If a global diag logger is already set, this will override it.
18 *
19 * @param logger - [Optional] The DiagLogger instance to set as the default logger.
20 * @param logLevel - [Optional] The DiagLogLevel used to filter logs sent to the logger. If not provided it will default to INFO.
21 * @returns true if the logger was successfully registered, else false
22 */
23 setLogger: (logger: DiagLogger, logLevel?: DiagLogLevel) => boolean;
24 /**
25 *
26 */
27 createComponentLogger: (options: ComponentLoggerOptions) => DiagLogger;
28 verbose: DiagLogFunction;
29 debug: DiagLogFunction;
30 info: DiagLogFunction;
31 warn: DiagLogFunction;
32 error: DiagLogFunction;
33 /**
34 * Unregister the global logger and return to Noop
35 */
36 disable: () => void;
37}
38//# sourceMappingURL=diag.d.ts.map
\No newline at end of file