File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 1
- const debug = require ( 'debug' ) ( 'splitter' ) ;
2
1
const _ = require ( 'lodash' ) ;
3
2
const { JsonataTransform } = require ( '@elastic.io/component-commons-library' ) ;
4
3
const { messages } = require ( 'elasticio-node' ) ;
@@ -7,6 +6,7 @@ const { messages } = require('elasticio-node');
7
6
* @this processAction
8
7
*/
9
8
async function processAction ( msg , cfg ) {
9
+ const self = this ;
10
10
const split = JsonataTransform . jsonataTransform ( msg , cfg ) ;
11
11
12
12
if ( ! Array . isArray ( split ) ) {
@@ -21,7 +21,7 @@ async function processAction(msg, cfg) {
21
21
22
22
const results = [ ] ;
23
23
split . forEach ( ( elem ) => results . push ( elem ) ) ;
24
- debug ( '%s parts to emit found' , results . length ) ;
24
+ self . logger . debug ( '%s parts to emit found' , results . length ) ;
25
25
results . forEach ( async ( result ) => {
26
26
if ( result ) {
27
27
await this . emit ( 'data' , messages . newMessageWithBody ( result ) ) ;
You can’t perform that action at this time.
0 commit comments