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

Make debug logs available through adb logcat in release builds #4011

Open
dkasak opened this issue Dec 9, 2024 · 4 comments
Open

Make debug logs available through adb logcat in release builds #4011

dkasak opened this issue Dec 9, 2024 · 4 comments
Labels
T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements

Comments

@dkasak
Copy link
Member

dkasak commented Dec 9, 2024

Your use case

What would you like to do?

Have debug logs available through adb logcat in release builds.

Why would you like to do it?

To make issues in production easier to debug, since logcat is far easier to grep and manipulate than files. The logs are already available through in-app retrievable log files, but this is much clunkier and harder to use.

How would you like to achieve it?

Ganfra informed me that currently the availability of logs over logcat is tied to the debuggable setting. Since release builds are not debuggable, no logs currently get sent to logcat. However, this relationship is not inherently require and we could in fact make the availability of logs through logcat not be tied to the debuggable setting.

Have you considered any alternatives?

No response

Additional context

For comparison, Signal has pretty detailed logcat logs in production builds which makes it far easier to debug issues.

I'm setting "no" to the question of providing a PR myself. This is mostly because I'm not familiar with what exactly needs to be done and I'm assuming EXA devs know much better than me. However I'm not completely closed off to researching and providing a PR if that's what's required to make it a reality.

Are you willing to provide a PR?

No

@dkasak dkasak added the T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements label Dec 9, 2024
@jmartinesp
Copy link
Member

Just a suggestion: maybe we could enable these through some settings? The logs go through the Rust FFI layer so they can affect performance a bit, and not having them enabled by default could mitigate some mistakes that could end up displaying sensitive info in the logs (they'd still be saved to disk, but accessing those files is harder).

@dkasak
Copy link
Member Author

dkasak commented Dec 10, 2024

So the files are currently created directly on the Rust layer and they never go through FFI?

For my own use case, I wouldn't at all mind flipping a setting as soon as I install and keeping it that way, so that's an okay compromise. Though I suppose I won't get pre-login logs (because settings are not available pre-login) which is a bit of a bummer.

But as for the other argument, who are we defending against? Apps on Android have been unable to read logs of other apps for a long time, so this is purely hiding the logs from the user. IMO, we have to up our game and never let sensitive info end up in the logs by mistake—logcat or not—since these mistakes would end up in rageshakes which is a problem in itself.

@spaetz
Copy link

spaetz commented Dec 10, 2024

who are we defending against?

Performance loss :-) SCNR.

@jmartinesp
Copy link
Member

So the files are currently created directly on the Rust layer and they never go through FFI?

Technically the text is sent to Rust through the FFI layer and written in the log files by Rust, and if the write_to_stdout_or_system flag is enabled (as it happens in debug and nightly builds) it calls a C function to write the text to the logcat, so there may not be any noticeable performance loss at all.

IMO, we have to up our game and never let sensitive info end up in the logs by mistake

Yep, that's why I said it might be a mitigation, since it would only make it more difficult for an attacker to get this data, but not impossible.

The proposed toggle might not make sense given the two points above, so just enabling the logs would be alright.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements
Projects
None yet
Development

No branches or pull requests

3 participants