@sipgate/integration-bridge 0.14.21 → 0.14.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/util/logger.util.js
CHANGED
|
@@ -10,13 +10,7 @@ const anonymize_key_1 = require("./anonymize-key");
|
|
|
10
10
|
* @param args additional data, will be stringified and appended
|
|
11
11
|
*/
|
|
12
12
|
const infoLogger = (source, message, apiKey, ...args) => {
|
|
13
|
-
|
|
14
|
-
if (apiKey) {
|
|
15
|
-
console.log(constructLogMessage(`[${(0, anonymize_key_1.anonymizeKey)(apiKey)}]`, `[${source}]`, message, args));
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
console.log(constructLogMessage(`[${source}]`, message, args));
|
|
19
|
-
}
|
|
13
|
+
logger(console.info, source, message, apiKey, args);
|
|
20
14
|
};
|
|
21
15
|
exports.infoLogger = infoLogger;
|
|
22
16
|
/**
|
|
@@ -27,13 +21,7 @@ exports.infoLogger = infoLogger;
|
|
|
27
21
|
* @param args additional data, will be stringified and appended
|
|
28
22
|
*/
|
|
29
23
|
const errorLogger = (source, message, apiKey, ...args) => {
|
|
30
|
-
|
|
31
|
-
if (apiKey) {
|
|
32
|
-
console.error(constructLogMessage(`[${(0, anonymize_key_1.anonymizeKey)(apiKey)}]`, `[${source}]`, message, args));
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
console.error(constructLogMessage(`[${source}]`, message, args));
|
|
36
|
-
}
|
|
24
|
+
logger(console.error, source, message, apiKey, args);
|
|
37
25
|
};
|
|
38
26
|
exports.errorLogger = errorLogger;
|
|
39
27
|
/**
|
|
@@ -44,15 +32,18 @@ exports.errorLogger = errorLogger;
|
|
|
44
32
|
* @param args additional data, will be stringified and appended
|
|
45
33
|
*/
|
|
46
34
|
const warnLogger = (source, message, apiKey, ...args) => {
|
|
35
|
+
logger(console.warn, source, message, apiKey, args);
|
|
36
|
+
};
|
|
37
|
+
exports.warnLogger = warnLogger;
|
|
38
|
+
const logger = (logFn, source, message, apiKey, ...args) => {
|
|
47
39
|
// eslint-disable-next-line no-console
|
|
48
40
|
if (apiKey) {
|
|
49
|
-
|
|
41
|
+
logFn(constructLogMessage(`[${(0, anonymize_key_1.anonymizeKey)(apiKey)}]`, `[${source}]`, message, args));
|
|
50
42
|
}
|
|
51
43
|
else {
|
|
52
|
-
|
|
44
|
+
logFn(constructLogMessage(`[${source}]`, message, args));
|
|
53
45
|
}
|
|
54
46
|
};
|
|
55
|
-
exports.warnLogger = warnLogger;
|
|
56
47
|
const constructLogMessage = (...args) => `${args
|
|
57
48
|
.flat()
|
|
58
49
|
.map((item) => typeof item !== "string" ? JSON.stringify(item) : item)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.util.js","sourceRoot":"","sources":["../../src/util/logger.util.ts"],"names":[],"mappings":";;;AAAA,mDAA+C;AAE/C;;;;;;GAMG;AACI,MAAM,UAAU,GAAG,CACxB,MAAc,EACd,OAAe,EACf,MAAe,EACf,GAAG,IAAe,EACZ,EAAE;IACR,
|
|
1
|
+
{"version":3,"file":"logger.util.js","sourceRoot":"","sources":["../../src/util/logger.util.ts"],"names":[],"mappings":";;;AAAA,mDAA+C;AAE/C;;;;;;GAMG;AACI,MAAM,UAAU,GAAG,CACxB,MAAc,EACd,OAAe,EACf,MAAe,EACf,GAAG,IAAe,EACZ,EAAE;IACR,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AACtD,CAAC,CAAC;AAPW,QAAA,UAAU,cAOrB;AAEF;;;;;;GAMG;AACI,MAAM,WAAW,GAAG,CACzB,MAAc,EACd,OAAe,EACf,MAAe,EACf,GAAG,IAAe,EACZ,EAAE;IACR,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AACvD,CAAC,CAAC;AAPW,QAAA,WAA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