Skip to content

Commit e0e5954

Browse files
author
Olha Virolainen
authored
Merge pull request #37 from elasticio/zubairov-patch-1
Significant improvement of the component log
2 parents cee673f + 1614d01 commit e0e5954

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
@@ -17,20 +17,22 @@ async function processAction(msg, cfg) {
1717
}
1818
this.logger.info('Evaluation completed');
1919
if (result === undefined || result === null || Object.keys(result).length === 0) {
20+
this.logger.info('Result from evaluation is empty object or null or undefined, no message will be send to the next step');
2021
return Promise.resolve();
2122
}
2223

2324
if (typeof result[Symbol.iterator] === 'function') {
2425
// We have an iterator as result
2526
// eslint-disable-next-line no-restricted-syntax
27+
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');
2628
for (const item of result) {
2729
// eslint-disable-next-line no-await-in-loop
2830
await this.emit('data', eioUtils.newMessageWithBody(item));
2931
}
3032

3133
return Promise.resolve();
3234
}
33-
35+
this.logger.info('1 message will be send to the next step');
3436
return Promise.resolve(eioUtils.newMessageWithBody(result));
3537
}
3638

0 commit comments

Comments
 (0)