feat(logging): stragglers -> AppLog (#330) #336

Merged
JMR-dev merged 4 commits from feat-330-logging-stragglers into main 2026-07-05 03:09:08 +00:00
JMR-dev commented 2026-07-05 02:09:51 +00:00 (Migrated from github.com)

Summary

  • Migrates RestartActivity's one raw Log.w call to AppLog.w, clearing the final raw android.util.Log site outside the auth/lock, DB/keystore, connectivity/send, and sync-engine migration areas (per #330's scope) — making the codebase ready for the future detekt android.util.Log guard (#331).
  • Scanned for other stray android.util.Log importers (grep import android.util.Log app/src/main): the only other hits are the 8 files already called out by the epic as belonging to the other four in-flight/not-yet-started migration areas (auth/lock, DB/keystore, connectivity/send, sync-engine/push), plus AppLog.kt itself. Nothing extra to fold in here.

Guard-compliance note

RestartActivity runs in the separate :restart trampoline process. There, LibreMailApplication.onCreate returns early (isRestartTrampolineProcess()) and never calls AppLog.install, so AppLog's buffer is null in that process. This migration is therefore guard-rule compliance + Logcat consistency only — it does not add a report breadcrumb, since this line reaches Logcat only, never a DebugReport. Behavior is unchanged: AppLog.w forwards to Logcat exactly like the raw Log.w it replaces. Added an inline comment at the call site explaining this so future readers don't expect it to show up in a report.

No PII: the logged value is the app's own packageName (org.libremail.app), not user data.

Test

RestartActivity is DEVICE-ONLY (multi-process kill/relaunch; see its KDoc) — a JVM test can't instantiate it, and there's no Robolectric in this repo. Per the ticket's test-expectation note, the "buffer captured the breadcrumb" pattern used by other AppLog migrations intentionally does not apply to this site. Instead, added RestartActivityLoggingTest (JVM, no emulator), which pins the null-buffer shape this call runs under in the trampoline process: AppLog.w forwards to Logcat and no-ops the buffer cleanly, mirroring the raw-Log.w behavior it replaces.

  • :app:testDebugUnitTest — green (including the new RestartActivityLoggingTest)
  • :app:compileDebugAndroidTestKotlin — green
  • :app:ktlintCheck — green
  • :app:detekt — green

Test plan

  • Unit test added and passing: RestartActivityLoggingTest
  • :app:testDebugUnitTest
  • :app:compileDebugAndroidTestKotlin
  • :app:ktlintCheck
  • :app:detekt

Closes #330
Part of #324

🤖 Generated with Claude Code

## Summary - Migrates `RestartActivity`'s one raw `Log.w` call to `AppLog.w`, clearing the final raw `android.util.Log` site outside the auth/lock, DB/keystore, connectivity/send, and sync-engine migration areas (per #330's scope) — making the codebase ready for the future detekt `android.util.Log` guard (#331). - Scanned for other stray `android.util.Log` importers (`grep import android.util.Log app/src/main`): the only other hits are the 8 files already called out by the epic as belonging to the other four in-flight/not-yet-started migration areas (auth/lock, DB/keystore, connectivity/send, sync-engine/push), plus `AppLog.kt` itself. Nothing extra to fold in here. ## Guard-compliance note `RestartActivity` runs in the separate `:restart` trampoline process. There, `LibreMailApplication.onCreate` returns early (`isRestartTrampolineProcess()`) and never calls `AppLog.install`, so `AppLog`'s buffer is null in that process. This migration is therefore **guard-rule compliance + Logcat consistency only** — it does not add a report breadcrumb, since this line reaches Logcat only, never a `DebugReport`. Behavior is unchanged: `AppLog.w` forwards to Logcat exactly like the raw `Log.w` it replaces. Added an inline comment at the call site explaining this so future readers don't expect it to show up in a report. No PII: the logged value is the app's own `packageName` (`org.libremail.app`), not user data. ## Test `RestartActivity` is DEVICE-ONLY (multi-process kill/relaunch; see its KDoc) — a JVM test can't instantiate it, and there's no Robolectric in this repo. Per the ticket's test-expectation note, the "buffer captured the breadcrumb" pattern used by other AppLog migrations intentionally does not apply to this site. Instead, added `RestartActivityLoggingTest` (JVM, no emulator), which pins the null-buffer shape this call runs under in the trampoline process: `AppLog.w` forwards to Logcat and no-ops the buffer cleanly, mirroring the raw-`Log.w` behavior it replaces. - [x] `:app:testDebugUnitTest` — green (including the new `RestartActivityLoggingTest`) - [x] `:app:compileDebugAndroidTestKotlin` — green - [x] `:app:ktlintCheck` — green - [x] `:app:detekt` — green ## Test plan - [x] Unit test added and passing: `RestartActivityLoggingTest` - [x] `:app:testDebugUnitTest` - [x] `:app:compileDebugAndroidTestKotlin` - [x] `:app:ktlintCheck` - [x] `:app:detekt` Closes #330 Part of #324 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.