Skip to content

Commit 1614d01

Browse files
author
Renat Zubairov
authored
Significant improvement of the component log
Would have saved me as an integrator user 1 hour of useless research
1 parent 842604e commit 1614d01

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/actions/transform.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,22 @@ async function processAction(msg, cfg) {
1818
}
1919
this.logger.info('Evaluation completed');
2020
if (result === undefined || result === null || Object.keys(result).length === 0) {
21+
this.logger.info('Result from evaluation is empty object or null or undefined, no message will be send to the next step');
2122
return Promise.resolve();
2223
}
2324

2425
if (typeof result[Symbol.iterator] === 'function') {
2526
// We have an iterator as result
2627
// eslint-disable-next-line no-restricted-syntax
28+
this.logger.info('Result from evaluation is an array, each item of the array will be send to the next step as a separate message');
2729
for (const item of result) {
2830
// eslint-disable-next-line no-await-in-loop
2931
await this.emit('data', eioUtils.newMessageWithBody(item));
3032
}
3133

3234
return Promise.resolve();
3335
}
34-
36+
this.logger.info('1 message will be send to the next step');
3537
return Promise.resolve(eioUtils.newMessageWithBody(result));
3638
}
3739

0 commit comments

Comments
 (0)