SdkLogger
Phase 34 Plan 01 (AND-LOG-01, AND-LOG-02, AND-LOG-03).
Single logging entry point for all :sdk-* modules. Every other file in :sdk-core, :sdk-ui, and :sdk-networking MUST route through this object — enforcement is provided by the checkNoAndroidLog Gradle task registered in AndroidLibraryConventionPlugin. This is the only file in the SDK allowed to import android.util.Log.
Filtering model
Two independent filters run in series:
Compile-time — v and d wrap the emit call in
if (isDebugBuild && ...). In release builds R8 observesBuildConfig.DEBUG == falseas a constant and strips the entire branch, so VERBOSE/DEBUG calls disappear from the release.aar. (AND-LOG-02)Runtime — i, w, e (and the debug branch above) additionally check
level.ordinal <= <callLevel>.ordinal. Hosts raise or lower this viaFeedbackConfig.logLevel(LogLevel.X). Setting the level to LogLevel.NONE silences every call. (AND-LOG-03)
Test seam (D-5 in 34-01-PLAN)
BuildConfig fields are static final and cannot be mocked from a JVM unit test. Instead, production reads BuildConfig.DEBUG once into isDebugBuildHook; tests flip the hook directly.
Similarly, android.util.Log is a stub on the JVM unit-test classpath (returns 0, records nothing). To verify emission/filtering without Robolectric, tests swap sink for a recording implementation.
Properties
Active threshold. Defaults to LogLevel.DEBUG in debug builds and LogLevel.WARN in release builds — verbose/debug calls are compile-time stripped in release anyway, but INFO is filtered out at runtime too so the release logcat only carries WARN+ERROR from the SDK unless the host opts in via FeedbackConfig.logLevel(...).