fix: route diagnostic output to logcat, fix tcsetpgrp for Real fds#41
Merged
Conversation
Add log module with vlog!/vlog_error! macros that resolve __android_log_print via dlsym at runtime. Replace all libc::write(2,...) and eprintln! calls with logcat logging. Only signal-safe crash handler writes remain on fd 2. Fix tcsetpgrp/tcgetpgrp fd table check: change !matches!(Vfd::Real(_)) to .is_some() so Real terminal fds (PTY slave) also get fake success, eliminating bash "cannot set terminal process group" warnings. Bahtya
…t, NUL handling - Replace variadic fn(...) with concrete 3-arg signature (stable Rust compatible) - Rename _Level → Level, _emit → emit (underscore prefix misleading for public API) - Use LOG_DEBUG/LOG_ERROR constants in match instead of magic numbers - Handle embedded NUL in CString::new with lossy fallback instead of silent drop Bahtya
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/log.rs— lightweight logcat logging via runtime-resolved__android_log_print(zero new crate dependencies)libc::write(2, ...)/eprintln!diagnostic calls withvlog!/vlog_error!macros that write to Android logcat instead of terminal stdout/stderrvdiag!macro to route through logcat as welltcsetpgrp/tcgetpgrpfd table check:!matches!(Vfd::Real(_))→.is_some()so PTY slave fds (stored asVfd::Real) also return fake success, eliminating bash "cannot set terminal process group" warningTest plan
cargo build --target aarch64-linux-androidls— "vproc: self-test skipped" should NOT appear in terminaladb logcat -s vproc— diagnostic messages should appear in logcatBahtya