From 99a3e13d77944a62278a99049c8fa1aa3f44195b Mon Sep 17 00:00:00 2001 From: Ruakij Date: Mon, 29 Nov 2021 15:35:36 +0100 Subject: [PATCH] Added further exception to error-event from tcpdump --- src/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index 5710070..5527113 100644 --- a/src/main.js +++ b/src/main.js @@ -78,8 +78,10 @@ if(errorMsg){ logger.debug("Attaching error-logger.."); const loggerTcpdump = logFactory("tcpdump"); proc.stderr.setEncoding("utf8").on("data", (data) => { - if(!data.match(/^(tcpdump: )?listening on /i)) // Catch start-error - loggerTcpdump.error(data); + if(!data.match(/^(tcpdump: )?listening on /i) || !data.match(/^\d+ packets captured/i)) { // Catch start-error + loggerTcpdump.debug(data); + } + else loggerTcpdump.error(data); }); regexBlockStream.on('error', (err) => {