1- /* eslint no-invalid-this: 0 no-console: 0 */
21const elasticio = require ( 'elasticio-node' ) ;
32
43const { messages } = elasticio ;
@@ -18,7 +17,7 @@ let unmarshaller;
1817 */
1918module . exports . process = function processAction ( msg , cfg ) {
2019 co ( function * gen ( ) {
21- this . logger . debug ( 'Action started cfg=%j' , cfg ) ;
20+ this . logger . debug ( 'Action started...' ) ;
2221 // We need to make sure we execute initialization only once
2322 yield lock . acquireAsync ( ) ;
2423 try {
@@ -31,9 +30,10 @@ module.exports.process = function processAction(msg, cfg) {
3130 -compact \
3231 -logLevel DEBUG \
3332 "${ cfg . schemaUri } "` ;
34- this . logger . debug ( 'Starting JAVA process cmd=%s' , cmd ) ;
33+ this . logger . debug ( 'Starting JAVA process...' ) ;
34+ // eslint-disable-next-line no-unused-vars
3535 const out = yield exec ( cmd ) ;
36- this . logger . debug ( '%s\nGeneration completed' , out ) ;
36+ this . logger . debug ( 'Generation completed' ) ;
3737 this . logger . debug ( 'Loading mappings from ./mappings/index.js' ) ;
3838 // eslint-disable-next-line global-require, import/no-unresolved
3939 const mappings = require ( '../../mappings' ) ;
@@ -50,18 +50,17 @@ module.exports.process = function processAction(msg, cfg) {
5050 if ( msg . body . xml && typeof msg . body . xml === 'string' ) {
5151 this . logger . info ( 'Found input data in incoming message length of XML is length=%s' , msg . body . xml . length ) ;
5252 const result = unmarshaller . unmarshalString ( msg . body . xml ) ;
53- this . logger . debug ( 'Parsed XML to JSON json=%j' , result ) ;
53+ this . logger . debug ( 'XML parsed to JSON' ) ;
5454 this . emit ( 'data' , messages . newMessageWithBody ( result ) ) ;
5555 } else if ( msg . attachments && Object . keys ( msg . attachments ) . length > 0 ) {
56- this . logger . info ( ' Found attachments in the message keys=%s' , Object . keys ( msg . attachments ) ) ;
56+ this . logger . info ( ` Found attachments in the message keys=${ Object . keys ( msg . attachments ) . length } ` ) ;
5757 this . emit ( 'data' , msg ) ;
5858 } else {
59- this . logger . debug ( 'No data XML payload found in the incoming message or it\'s attachments, '
60- + 'no processing will be done msg=%j' , msg ) ;
59+ this . logger . debug ( 'No data XML payload found in the incoming message or it\'s attachments' ) ;
6160 }
6261 this . emit ( 'end' ) ;
6362 } . bind ( this ) ) . catch ( ( err ) => {
64- this . logger . info ( 'Error occurred' , err . stack || err ) ;
63+ this . logger . info ( 'Error in parsing occurred' ) ;
6564 this . emit ( 'error' , err ) ;
6665 this . emit ( 'end' ) ;
6766 } ) ;
0 commit comments