-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGoogleLog.js
31 lines (29 loc) · 870 Bytes
/
GoogleLog.js
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
const { DecoratedLog } = require("./DecoratedLog.js");
const { Dictionary } = require("./Dictionary.js");
const { JsLog } = require("./JsLog.js");
/**
* @inheritDoc
*/
class GoogleLog extends DecoratedLog {
constructor(origin = new JsLog) {
const dict = (new Dictionary)
.withEntries({
'default': 'DEFAULT',
'debug': 'DEBUG',
'info': 'INFO',
'notice': 'NOTICE',
'warn': 'WARNING',
'error': 'ERROR',
'critical': 'CRITICAL',
'alert': 'ALERT',
'emergency': 'EMERGENCY',
})
.withDefaultVal('INFO');
super(
origin.newWithJsObj({
severity: dict.valByKeyOrDefault( origin.level() )
})
);
}
}
module.exports = {GoogleLog};