@@ -12,22 +12,19 @@ var DEFAULT_IS_SILENT = false;
12
12
13
13
// Remaping winston level on Application Insights
14
14
function getMessageLevel ( winstonLevel ) {
15
-
16
- // TODO: Find a way to get the actual level values from AI's SDK
17
- // They are defined in SDK's "Library/Contracts.ts"
18
-
15
+
19
16
var levels = {
20
- emerg : 4 , // AI ' Critical'
21
- alert : 4 , // AI ' Critical'
22
- crit : 4 , // AI ' Critical'
23
- error : 3 , // AI ' Error'
24
- warning : 2 , // AI ' Warning'
25
- warn : 2 , // AI ' Warning'
26
- notice : 1 , // AI 'Informational'
27
- info : 1 , // AI 'Informational'
28
- verbose : 0 , // AI ' Verbose'
29
- debug : 0 , // AI ' Verbose'
30
- silly : 0 // AI ' Verbose'
17
+ emerg : appInsights . Contracts . SeverityLevel . Critical ,
18
+ alert : appInsights . Contracts . SeverityLevel . Critical ,
19
+ crit : appInsights . Contracts . SeverityLevel . Critical ,
20
+ error : appInsights . Contracts . SeverityLevel . Error ,
21
+ warning : appInsights . Contracts . SeverityLevel . Warning ,
22
+ warn : appInsights . Contracts . SeverityLevel . Warning ,
23
+ notice : appInsights . Contracts . SeverityLevel . Information ,
24
+ info : appInsights . Contracts . SeverityLevel . Information ,
25
+ verbose : appInsights . Contracts . SeverityLevel . Verbose ,
26
+ debug : appInsights . Contracts . SeverityLevel . Verbose ,
27
+ silly : appInsights . Contracts . SeverityLevel . Verbose
31
28
} ;
32
29
33
30
return winstonLevel in levels ? levels [ winstonLevel ] : levels . info ;
0 commit comments