Skip to content

Conversation

@wheregmis
Copy link
Contributor

@wheregmis wheregmis commented Oct 28, 2025

Plan is to pipe either fatal or RustStdoutStder into default, and all verbose when tracing is on in CLI.

When tracing is off, we strip the adb logcat prefix
image

When tracing is on, we just forward the logs without stripping anything (As there could be other logs outside of RustStdoutStder which might be helpful to know where its originated from)

00:42:19 [android] I/RustStdoutStderr( 7764): [1028/004219.017517:ERROR:android_webview/browser/variations/variations_seed_loader.cc:39] Seed missing signature.
00:42:19 [android] I/RustStdoutStderr( 7764): [1028/004219.030175:INFO:android_webview/browser/variations/variations_seed_loader.cc:67] Failed to open file for reading.: No such file or directory (2)
00:42:20 [android] I/RustStdoutStderr( 7764): [WARNING:net/dns/dns_config_service_android.cc:69] Failed to read DnsConfig.
00:42:20 [android] I/RustStdoutStderr( 7764): [WARNING:android_webview/browser/network_service/net_helpers.cc:143] HTTP Cache size is: 20971520
00:42:20 [android] I/RustStdoutStderr( 7764): s_glBindAttribLocation: bind attrib 0 name position
00:42:20 [android] I/RustStdoutStderr( 7764): s_glBindAttribLocation: bind attrib 1 name color
00:42:22 [android] I/RustStdoutStderr( 7764): s_glBindAttribLocation: bind attrib 0 name inPosition
00:42:22 [android] I/RustStdoutStderr( 7764): s_glBindAttribLocation: bind attrib 1 name inColor
00:42:22 [android] I/RustStdoutStderr( 7764): s_glBindAttribLocation: bind attrib 2 name inCircleEdge
00:42:22 [android] I/RustStdoutStderr( 7764): s_glBindAttribLocation: bind attrib 0 name inPosition
00:42:22 [android] I/RustStdoutStderr( 7764): s_glBindAttribLocation: bind attrib 1 name inColor
00:42:22 [android] I/RustStdoutStderr( 7764): s_glBindAttribLocation: bind attrib 2 name inTextureCoords
00:42:22 [android] I/RustStdoutStderr( 7764): s_glBindAttribLocation: bind attrib 0 name inPosition
00:42:22 [android] I/RustStdoutStderr( 7764): s_glBindAttribLocation: bind attrib 1 name inColor
00:42:22 [android] I/RustStdoutStderr( 7764): s_glBindAttribLocation: bind attrib 2 name inCircleEdge
00:42:22 [android] I/RustStdoutStderr( 7764): s_glBindAttribLocation: bind attrib 0 name position
00:42:22 [android] I/RustStdoutStderr( 7764): s_glBindAttribLocation: bind attrib 1 name localCoord
image

- Introduced adb_logcat fields to manage Android logcat output.
- Implemented logcat spawning and parsing to differentiate log levels.
- Updated push_stdio method to filter Android logs based on trace settings.
- Added utility functions for retrieving app PID and parsing logcat levels.
@wheregmis wheregmis changed the title Pipe ADB logs into CLI Pipe Android/ADB logs into CLI Oct 28, 2025
- Improved log level detection by checking for prefixes after the colon in messages.
- Enhanced filtering to only show logs with standard tracing levels or fatal errors.
- Streamlined the process of stripping logcat metadata while preserving message content.
@wheregmis wheregmis marked this pull request as ready for review October 28, 2025 04:58
@wheregmis wheregmis requested a review from a team as a code owner October 28, 2025 04:58
@jkelleyrtp
Copy link
Member

Thanks for the PR!

I made some changes to make this code fit better with the rest of the codebase.

Some feedback:

  • We don't want to block any arms of the top-level serve command for too long, so I moved the logcat stdout reader into its own task
  • The logcat stdout reader now just sends it messages over a buffer which is a bit nicer to process
  • I flattened the log cleanup in the push_log method. It's better to not have so many early returns everywhere, and instead try to process things linearly.

Otherwise, this is a much much much nicer experience than what we needed to do earlier for adb logcat. Thanks so much for helping implement it!

@jkelleyrtp jkelleyrtp merged commit 6e3f362 into DioxusLabs:main Oct 28, 2025
19 checks passed
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