From 0b09f1d87e50b1abe23f8a7d06accb4f51e7c92b Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Wed, 5 Feb 2020 11:36:41 +0200 Subject: [PATCH] do not log fetch responses --- imap-core/lib/imap-composer.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/imap-core/lib/imap-composer.js b/imap-core/lib/imap-composer.js index bae3b889..939b024c 100644 --- a/imap-core/lib/imap-composer.js +++ b/imap-core/lib/imap-composer.js @@ -48,15 +48,17 @@ class IMAPComposer extends Transform { let compiled = obj.compiled ? obj.compiled : imapHandler.compiler(obj); - this.connection.logger.debug( - { - tnx: 'send', - cid: this.connection.id - }, - '[%s] S:', - this.connection.id, - compiled - ); + if (!this.skipFetchLog || (!obj.compiled && this.skipFetchLog)) { + this.connection.logger.debug( + { + tnx: 'send', + cid: this.connection.id + }, + '[%s] S:', + this.connection.id, + compiled + ); + } this.push(Buffer.from(compiled + '\r\n', 'binary')); done();