-
Notifications
You must be signed in to change notification settings - Fork 0
/
nova-ai-logger.d.ts
56 lines (41 loc) · 2.11 KB
/
nova-ai-logger.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
49
50
51
52
53
54
55
56
declare module "@nova/ai-logger" {
// IMPORTS AND RE-EXPORTS
// --------------------------------------------------------------------------------------------
import * as nova from '@nova/core';
export { TraceSource, TraceCommand, TraceDetails } from '@nova/core';
// GLOBAL LOGGER
// --------------------------------------------------------------------------------------------
export type LogLevel = 'debug' | 'information' | 'warning' | 'error';
export interface LoggerConfig {
readonly iKey : string;
readonly appVersion? : string;
readonly appName? : string;
readonly appInstance? : string;
readonly logLevel? : { [key: string]: LogLevel };
}
export function configure(options: LoggerConfig): void;
export function debug(message: string) : void;
export function info(message: string) : void;
export function warn(message: string) : void;
export function error(error: Error) : void;
export function track(metric: string, value: number): void;
export function startOperation(options: OperationOptions, startTime?: number): OperationLogger;
export function flush(isAppCrashing: boolean, callback?: (message: string) => void): void;
// OPERATION LOGGER
// --------------------------------------------------------------------------------------------
export type SourceType = 'http' | 'sql' | 'redis' | 'azure queue' | 'azure service bus' | 'azure blob' | 'azure table' | 'web service';
export interface OperationOptions {
readonly operationId : string;
readonly operationName : string;
readonly requestName? : string;
readonly requestUrl? : string;
readonly requestIp? : string;
readonly componentName? : string;
readonly parentId? : string;
}
export interface OperationLogger extends nova.Logger {
readonly operationId : string;
authenticatedUserId? : string;
close(resultCode: number, success: boolean, details?: { [key: string]: string; }): void;
}
}