beeware / beeware/briefcase

Add customised log filtering for Android

Open
#822 0 comments 0 reactions 0 assignees View on GitHub
android enhancement
Dominant language
Python
Stars
3.3k
Forks
549
Avg merge
1d 4h
Merged PRs (30d)
40

Description

When an app runs on Android, we currently expose *all* log messages generated by the app. In some circumstances, this can result in excessive logs being displayed.

`adb logcat` provides the ability to filter the log stream by log level and by component; a user should be able to configure this log level.

**Describe the solution you'd like**

It should be possible to pass one or more options to `briefcase run android` to:
* control the verbosity of the logs that are displayed to the user;
* exclude log messages from specific components; and/or
* reduce the output to *only* specific components

**Describe alternatives you've considered**

This could be achieved in multiple ways:

1. Exposing a single option that describes the full string of options passed to the `logcat` command (e.g., `--logcat "-s *:I Python:E`). This is the most flexible option, as it exposes *any* capability of `adb logcat`.
2. Exposing a multi-use option to define individual arguments to pass to `logcat` (e.g., `--logcat "-s" --logcat "*:I" --logcat Python:E`) This has the flexibility of option (1), but removes the need to parse the filter into individual arguments; however, it is more verbose.
3. Exposing a high-level `--debuglog` option that enables/disables a filter to include DEBUG level output. This option requires less expertise on the part of the end-user, but removes considerable flexibility. However, from the perspective of the end user, it's more likely to be aligned with their needs - display "just the important logs" by default, but provide an easy option to get everything else.

**Additional context**

This is an extension of #821, introduced to address #814.

#821 deliberately adds a filter for `EGL_emulation` messages because they are excessively verbose; this indicates that there is a *some* need to filter logs.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.