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(android): ignoreLog config #13560

Merged
merged 1 commit into from
Sep 25, 2022
Merged

feat(android): ignoreLog config #13560

merged 1 commit into from
Sep 25, 2022

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Sep 9, 2022

Adds a quick way to filter out lines in the android log using ti config

New key: cli.ignoreLog = []
if one of the lines is in the log line it will be ignored.

Example:

"cli": {
  "ignoreLog": [
    "Too many Flogger logs received before configuration",
    "Counters: exceeded sample count in FrameTime",
    "OpenGLRenderer: Davey!"
  ]
}

will filter out those nasty map logs.

TODO:
we don't have a page with the CLI config parameters. Should be somewhere in the titanium repo I guess

@hansemannn
Copy link
Collaborator

I think there are some ignored pattern already - can we add the new one to them?

@m1ga
Copy link
Contributor Author

m1ga commented Sep 9, 2022

there is nonTiLogRegexp https://github.com/tidev/titanium_mobile/blob/177c6e1a11ca9737b9433506582c9fc9be0847b0/android/cli/hooks/run.js#L244 to regex some non-ti logs but this one is easier to manage and the user should set them himself (like the filter in Android Studio). I don't want to filter them out completly perhaps someone needs them (I don't think so since native users complain about it too https://stackoverflow.com/questions/70214824/too-many-flogger-logs-received-before-configuration-dropping-old-logs 😄 ).

@hansemannn
Copy link
Collaborator

hansemannn commented Sep 10, 2022

Okay, then I suppose it's okay. But we have to remember that it's calling the whole loop for every incoming log message, which is why the regex was used and is much faster. I am therefore unsure regarding performance.

@m1ga
Copy link
Contributor Author

m1ga commented Sep 10, 2022

Ah I understand! Since there aren't any default settings (so no loop for most users) I see it as a trade-off between usability/cleaner output and performance (if there any at all). It shouldn't affect the app since the loop is on the computer.

The workaround is to use Android Studio LogCat and add the filters in there. So you have Studio running AND it loops through its filters for every line it logs. Guess that is worse for your machine then the CLI output 😄

Not seeing those annoying maps logs in debug mode is soooo much better!

@hansemannn
Copy link
Collaborator

We should provide a default set of ignored lines in the config file for new installations, what do you think?

@m1ga
Copy link
Contributor Author

m1ga commented Sep 11, 2022

I've added the key to the config: https://github.com/tidev/titanium/pull/597/files but I think we should leave it empty. Otherwise the user won't see the log and might miss stuff. Not every app has a map so adding that will create an unnecessary check.

I think the key is to inform the user that it is now possible to remove those logs. But every dev should see them and opt-out.

Not many people complained about those logs 😄

@hansemannn hansemannn merged commit 4c042ee into master Sep 25, 2022
@m1ga m1ga deleted the androidLog branch September 25, 2022 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants