-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathindex.d.ts
48 lines (44 loc) · 1.2 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
export interface SeqLoggerConfig {
serverUrl?: string
apiKey?: string
maxBatchingTime?: number
eventSizeLimit?: number
batchSizeLimit?: number
requestTimeout?: number
maxRetries?: number
retryDelay?: number
onError: (e: Error) => void
onRemoteConfigChange?: (remoteConfig: RemoteConfig) => void
}
export type SeqLogLevel = 'Verbose' | 'Debug' | 'Information' | 'Warning' | 'Error' | 'Fatal'
export interface RemoteConfig {
MinimumLevelAccepted: SeqLogLevel | null
}
export interface SeqEvent {
timestamp: Date
level?: string
traceId?: string
spanId?: string
messageTemplate?: string
properties?: object
exception?: string
}
export declare class Logger {
constructor (config: SeqLoggerConfig)
/**
* Enqueue an event in Seq format.
* @param {*} event
* @returns {void}
*/
emit (event: SeqEvent): void
/**
* Flush then destroy connections, close the logger, destroying timers and other resources.
* @returns {Promise<void>}
*/
close (): Promise<void>
/**
* Flush events queued at the time of the call, and wait for pending writes to complete regardless of configured batching/timers.
* @returns {Promise<boolean}
*/
flush (): Promise<boolean>
}