From eabedaaf1e7806134b3be9f3c506427b94f524cb Mon Sep 17 00:00:00 2001 From: Michael Gangolf Date: Wed, 10 Jan 2024 19:46:03 +0100 Subject: [PATCH] feat(ios): add cli.ignoreLog to ios (#13939) * feat(ios): add cli.ignoreLog to ios * shorter syntax * shorter syntax --- android/cli/hooks/run.js | 6 ++---- iphone/cli/hooks/run.js | 7 +++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/android/cli/hooks/run.js b/android/cli/hooks/run.js index 0d5d1081d8b..42bc7fa36fa 100644 --- a/android/cli/hooks/run.js +++ b/android/cli/hooks/run.js @@ -268,10 +268,8 @@ exports.init = function (logger, config, cli) { } // ignore some Android logs in info log level - for (let i = 0, len = ignoreLog.length; i < len; ++i) { - if (line.includes(ignoreLog[i])) { - return; - } + if (ignoreLog.some(ignoreItem => line.includes(ignoreItem))) { + return; } switch (logLevel) { diff --git a/iphone/cli/hooks/run.js b/iphone/cli/hooks/run.js index e3e9b05e40c..ec41e90b7c6 100644 --- a/iphone/cli/hooks/run.js +++ b/iphone/cli/hooks/run.js @@ -20,6 +20,7 @@ exports.init = function (logger, config, cli) { const i18n = require('node-appc').i18n(__dirname); const __ = i18n.__; const __n = i18n.__n; + const ignoreLog = config.cli.ignoreLog || []; if (cli.argv['build-only']) { logger.info(__('Performed build only, skipping running of the application')); @@ -72,6 +73,12 @@ exports.init = function (logger, config, cli) { lastLogger = m[2].toLowerCase(); line = m[4].trim(); } + + // ignore logs from cli ignoreLog + if (ignoreLog.some(ignoreItem => line.includes(ignoreItem))) { + return; + } + if (levels.indexOf(lastLogger) === -1) { logger.log(('[' + lastLogger.toUpperCase() + '] ').cyan + line); } else {