@tiledesk/tiledesk-tybot-connector 2.0.10-rc5 → 2.0.10-rc6
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/Logger.js +0 -1
- package/logs/app.log +395 -34181
- package/logs/app6.log +15373 -0
- package/package.json +1 -1
- package/tiledeskChatbotPlugs/directives/DirFlowLog.js +21 -9
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
const { Logger } = require('../../Logger');
|
|
4
|
+
const { TiledeskChatbot } = require('../../engine/TiledeskChatbot');
|
|
5
|
+
const { Filler } = require('../Filler');
|
|
4
6
|
const winston = require('../../utils/winston');
|
|
7
|
+
|
|
5
8
|
let levels = ['error', 'warn', 'info', 'debug'];
|
|
6
9
|
|
|
7
10
|
class DirFlowLog {
|
|
@@ -38,7 +41,6 @@ class DirFlowLog {
|
|
|
38
41
|
|
|
39
42
|
async go(action, callback) {
|
|
40
43
|
winston.debug("(DirFlowLog) Action: ", action);
|
|
41
|
-
console.log("(DirFlowLog) Action: ", action);
|
|
42
44
|
|
|
43
45
|
let level = action.level || 'info';
|
|
44
46
|
if (!levels.includes(level)) {
|
|
@@ -52,21 +54,31 @@ class DirFlowLog {
|
|
|
52
54
|
callback();
|
|
53
55
|
}
|
|
54
56
|
|
|
57
|
+
let requestVariables = null;
|
|
58
|
+
requestVariables =
|
|
59
|
+
await TiledeskChatbot.allParametersStatic(
|
|
60
|
+
this.tdcache, this.requestId
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
const filler = new Filler();
|
|
64
|
+
const filled_log = filler.fill(action.log, requestVariables);
|
|
65
|
+
winston.debug("(DirFlowLog) fille log: ", filled_log);
|
|
66
|
+
|
|
55
67
|
if (level === 'error') {
|
|
56
|
-
winston.info("Adding log " +
|
|
57
|
-
this.logger.error(
|
|
68
|
+
winston.info("Adding log '" + filled_log + "' with level " + level);
|
|
69
|
+
this.logger.error(filled_log);
|
|
58
70
|
}
|
|
59
71
|
else if (level === 'warn') {
|
|
60
|
-
winston.info("Adding log " +
|
|
61
|
-
this.logger.warn(
|
|
72
|
+
winston.info("Adding log '" + filled_log + "' with level " + level);
|
|
73
|
+
this.logger.warn(filled_log);
|
|
62
74
|
}
|
|
63
75
|
else if (level === 'info') {
|
|
64
|
-
winston.info("Adding log " +
|
|
65
|
-
this.logger.info(
|
|
76
|
+
winston.info("Adding log '" + filled_log + "' with level " + level);
|
|
77
|
+
this.logger.info(filled_log);
|
|
66
78
|
}
|
|
67
79
|
else if (level === 'debug') {
|
|
68
|
-
winston.info("Adding log " +
|
|
69
|
-
this.logger.debug(
|
|
80
|
+
winston.info("Adding log '" + filled_log + "' with level " + level);
|
|
81
|
+
this.logger.debug(filled_log);
|
|
70
82
|
}
|
|
71
83
|
|
|
72
84
|
callback();
|