diff --git a/lib/outgoing/index.js b/lib/outgoing/index.js index 42dba33..9c2784d 100644 --- a/lib/outgoing/index.js +++ b/lib/outgoing/index.js @@ -74,7 +74,7 @@ module.exports = async (logger, config, xmpp, user, destination, message, type, if (statusCode === 200) { logger.trace('Response:', body) if (body && typeof (body) === 'object' && 'reply' in body === true) { - logger.debug(`There is a reply to send back in chat ${destination}: ${body.reply}`) + logger.debug(`There is a reply to send back in chat ${destination}: ${body.reply.replace(/\n|\r/g, ' ')}`) xmpp.send(destination, body.reply, type) return `Message sent. There is a reply to send back in chat ${destination}: ${body.reply}` } diff --git a/lib/xmpp/index.js b/lib/xmpp/index.js index 71b4311..177f8db 100644 --- a/lib/xmpp/index.js +++ b/lib/xmpp/index.js @@ -17,7 +17,7 @@ module.exports = (logger, config) => { // declare send chat/groupchat function this.send = async (to, message, type) => { - logger.debug(`Send ${type} message to ${to}: '${message}'`) + logger.debug(`Send ${type} message to ${to}: '${message.replace(/\n|\r/g, ' ')}'`) const stanza = xml( 'message', { to, @@ -125,7 +125,7 @@ module.exports = (logger, config) => { } } logger.info(`Incoming ${type} message from ${from} (${fromJid.toString()}) to ${to}`) - logger.debug(`Message: "${message}"`) + logger.debug(`Message: "${message.replace(/\n|\r/g, ' ')}"`) let xmppHook = config.getXmppHookAction(to.toString()) if (!xmppHook) { logger.error(`There is no action for incoming ${type} message to: "${to}"`)