Problem
moq_tokio::Log::init routes logs to logcat only when the android-logcat feature is enabled, and to stderr otherwise. Android app processes discard stderr, so without the feature every Rust log is lost.
No shipped build enables the feature (at a0929c90b):
rs/moq-tokio/src/log.rs:69: the logcat layer is gated on all(target_os = "android", feature = "android-logcat").
rs/libmoq/Cargo.toml: there is no [features] section, so a C API consumer cannot enable it.
rs/moq-ffi/Cargo.toml:29: android-logcat is declared but not in default, and rs/moq-ffi/build.sh:133 builds Android targets without it. release-kt-ffi.yml and release-dart-ffi.yml call that script, so the published Kotlin and Dart bindings log to stderr on Android too.
Measured behavior
On an Android device, with libmoq built with the gate removed and no extra features, moq_log_level("info") sends logs to logcat:
W MoQNative: moq_tokio::tls: TLS server certificate verification is disabled; ...
I MoQNative: moq_tokio::client: connected version=moq-lite-05
Possible approaches
- Always use logcat on Android. Gate the layer on
target_os = "android" alone, make tracing-android a regular Android-only dependency, and remove the android-logcat feature from moq-tokio and moq-ffi. Other targets are unaffected, and logging stays opt-in at runtime because Log::init runs only when the app calls moq_log_level. This is a breaking change: builds that pass --features android-logcat stop resolving.
- Keep the feature and enable it where it is missing. Add
android-logcat = ["moq-tokio/android-logcat"] to libmoq, and pass it in moq-ffi/build.sh for Android targets. Not breaking, but every Android consumer still has to know to turn it on.
I have (1) working locally and can send a PR for either; since (1) is breaking, I'd like your call before opening it.
(Written by Claude Opus 5.5)
Problem
moq_tokio::Log::initroutes logs to logcat only when theandroid-logcatfeature is enabled, and to stderr otherwise. Android app processes discard stderr, so without the feature every Rust log is lost.No shipped build enables the feature (at
a0929c90b):rs/moq-tokio/src/log.rs:69: the logcat layer is gated onall(target_os = "android", feature = "android-logcat").rs/libmoq/Cargo.toml: there is no[features]section, so a C API consumer cannot enable it.rs/moq-ffi/Cargo.toml:29:android-logcatis declared but not indefault, andrs/moq-ffi/build.sh:133builds Android targets without it.release-kt-ffi.ymlandrelease-dart-ffi.ymlcall that script, so the published Kotlin and Dart bindings log to stderr on Android too.Measured behavior
On an Android device, with libmoq built with the gate removed and no extra features,
moq_log_level("info")sends logs to logcat:Possible approaches
target_os = "android"alone, maketracing-androida regular Android-only dependency, and remove theandroid-logcatfeature frommoq-tokioandmoq-ffi. Other targets are unaffected, and logging stays opt-in at runtime becauseLog::initruns only when the app callsmoq_log_level. This is a breaking change: builds that pass--features android-logcatstop resolving.android-logcat = ["moq-tokio/android-logcat"]tolibmoq, and pass it inmoq-ffi/build.shfor Android targets. Not breaking, but every Android consumer still has to know to turn it on.I have (1) working locally and can send a PR for either; since (1) is breaking, I'd like your call before opening it.
(Written by Claude Opus 5.5)