Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ios): add cli.ignoreLog to ios #13939

Merged
merged 3 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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 @@
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 All @@ -88,7 +95,7 @@
const logFile = path.join(HOME, `Library/Containers/${builder.tiapp.id}/Data/Documents/${builder.tiapp.guid}.log`);

// TODO: It does force quit. Find another way to quit.
exec(`pkill -QUIT -x ${builder.tiapp.name}`, function () {

Check warning on line 98 in iphone/cli/hooks/run.js

View workflow job for this annotation

GitHub Actions / JavaScript

Found child_process.exec() with non Literal first argument
// If there's already a log file from previous run, wipe it
if (fs.pathExistsSync(logFile)) {
try {
Expand Down
Loading