Context
The client crate logs through log / tracing macros, but the Android build of libcooklang_sync_client.so installs no logger, so nothing the engine says reaches logcat. run_download_once even sets CARGO_LOG=trace, which has no effect there. On iOS the app gets errors only through the thrown SyncError; on Android the same, and until cook-md/android-app-private#737 the app was masking that error as well. Diagnosing a 402 from the sync server on a device took a temporary log line in the app and a second run.
Proposal
- Behind the
ffi feature on Android targets, install android_logger once (for example in SyncContext::new() or a dedicated init_logging() export), at info by default and debug when a flag is set.
- Log the request path and HTTP status on every non-2xx response in
remote.rs, since these are what get folded into SyncError::Unknown("... failed with status: ...") and Check download failed: ....
- Consider mirroring on iOS with
oslog so both hosts get the same signal.
Why
Every failure in download_loop other than 401 and 402 is wrapped into SyncError::Unknown, including plain network errors, so without engine logs the host app cannot tell a server 5xx from a dropped connection.
Context
The client crate logs through
log/tracingmacros, but the Android build oflibcooklang_sync_client.soinstalls no logger, so nothing the engine says reaches logcat.run_download_onceeven setsCARGO_LOG=trace, which has no effect there. On iOS the app gets errors only through the thrownSyncError; on Android the same, and until cook-md/android-app-private#737 the app was masking that error as well. Diagnosing a 402 from the sync server on a device took a temporary log line in the app and a second run.Proposal
ffifeature on Android targets, installandroid_loggeronce (for example inSyncContext::new()or a dedicatedinit_logging()export), atinfoby default anddebugwhen a flag is set.remote.rs, since these are what get folded intoSyncError::Unknown("... failed with status: ...")andCheck download failed: ....oslogso both hosts get the same signal.Why
Every failure in
download_loopother than 401 and 402 is wrapped intoSyncError::Unknown, including plain network errors, so without engine logs the host app cannot tell a server 5xx from a dropped connection.