1 | import { Context, ContextValue, UserConfiguration } from '@datadog/browser-core';
|
2 | import { HandlerType, Logger, StatusType } from './logger';
|
3 | import { startLogs } from './logs';
|
4 | export interface LogsUserConfiguration extends UserConfiguration {
|
5 | forwardErrorsToLogs?: boolean;
|
6 | }
|
7 | export interface LoggerConfiguration {
|
8 | level?: StatusType;
|
9 | handler?: HandlerType;
|
10 | context?: Context;
|
11 | }
|
12 | export declare type Status = keyof typeof StatusType;
|
13 | export declare type LogsGlobal = ReturnType<typeof makeLogsGlobal>;
|
14 | export declare const datadogLogs: {
|
15 | logger: Logger;
|
16 | init: (userConfiguration: LogsUserConfiguration) => void;
|
17 | setLoggerGlobalContext: (newContext: Context) => void;
|
18 | addLoggerGlobalContext: (key: string, value: ContextValue) => void;
|
19 | removeLoggerGlobalContext: (key: string) => void;
|
20 | createLogger: (name: string, conf?: LoggerConfiguration) => Logger;
|
21 | getLogger: (name: string) => Logger | undefined;
|
22 | } & {
|
23 | onReady(callback: () => void): void;
|
24 | };
|
25 | export declare type StartLogs = typeof startLogs;
|
26 | export declare function makeLogsGlobal(startLogsImpl: StartLogs): {
|
27 | logger: Logger;
|
28 | init: (userConfiguration: LogsUserConfiguration) => void;
|
29 | setLoggerGlobalContext: (newContext: Context) => void;
|
30 | addLoggerGlobalContext: (key: string, value: ContextValue) => void;
|
31 | removeLoggerGlobalContext: (key: string) => void;
|
32 | createLogger: (name: string, conf?: LoggerConfiguration) => Logger;
|
33 | getLogger: (name: string) => Logger | undefined;
|
34 | } & {
|
35 | onReady(callback: () => void): void;
|
36 | };
|