Skip to content

Commit

Permalink
feat(ios): add cli.ignoreLog to ios (#13939)
Browse files Browse the repository at this point in the history
* feat(ios): add cli.ignoreLog to ios

* shorter syntax

* shorter syntax
  • Loading branch information
m1ga authored Jan 10, 2024
1 parent 9d416d3 commit eabedaa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 2 additions & 4 deletions android/cli/hooks/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 7 additions & 0 deletions iphone/cli/hooks/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit eabedaa

Please sign in to comment.