odsl-javascript-sdk 1.1.4 → 1.1.5
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/package.json +1 -1
- package/src/process.js +10 -1
package/package.json
CHANGED
package/src/process.js
CHANGED
|
@@ -40,8 +40,13 @@ module.exports = class PROCESS {
|
|
|
40
40
|
this.phase.status = status;
|
|
41
41
|
this.phase.message = mess;
|
|
42
42
|
this.phase.timestamp = new Date().toISOString().substring(0,19);
|
|
43
|
-
let level =
|
|
43
|
+
let level = "INFO";
|
|
44
44
|
let lm = new Date().toISOString() + " " + level + " " + mess;
|
|
45
|
+
if (status == "failed") {
|
|
46
|
+
level = "SEVERE";
|
|
47
|
+
lm = new Date().toISOString() + " " + level + " " + mess;
|
|
48
|
+
this.phase.warnings.push(lm);
|
|
49
|
+
}
|
|
45
50
|
this.phase.log.push(lm);
|
|
46
51
|
await this.updateProcess(this.phase);
|
|
47
52
|
}
|
|
@@ -49,6 +54,9 @@ module.exports = class PROCESS {
|
|
|
49
54
|
async logMessage(level, mess) {
|
|
50
55
|
let lm = new Date().toISOString() + " " + level + " " + mess;
|
|
51
56
|
console.log(lm);
|
|
57
|
+
if (level == "WARNING" || level == "SEVERE") {
|
|
58
|
+
this.phase.warnings.push(lm);
|
|
59
|
+
}
|
|
52
60
|
this.phase.log.push(lm);
|
|
53
61
|
await this.updateProcess(this.phase);
|
|
54
62
|
}
|
|
@@ -70,6 +78,7 @@ module.exports = class PROCESS {
|
|
|
70
78
|
class ProcessMessage {
|
|
71
79
|
constructor(p, t) {
|
|
72
80
|
this.log = [];
|
|
81
|
+
this.warnings = [];
|
|
73
82
|
this.timestamp = new Date().toISOString().substring(0,19);
|
|
74
83
|
this.type = "ProcessMessage";
|
|
75
84
|
this.id = t._id;
|