From 991687a33e563c579a24c19c729fb695593611de Mon Sep 17 00:00:00 2001 From: davotoula Date: Thu, 24 Sep 2026 14:47:34 +0200 Subject: [PATCH] docs(playback): correct the log-level claims guarding the diagnostic traces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both comments described levels no variant actually uses. DEFAULT_LOG_LEVEL gives debug builds INFO (not DEBUG) and release WARN (not ERROR), and the `benchmark` build type counts as `isDebug`, so it gets INFO too rather than being the silent release-like variant the text implied. The practical consequence was the misleading part: both said a debug build is enough to capture the trace. It is not — these are `Log.d`, which needs `minLevel <= DEBUG`, so PlaybackDiag and VideoQuality are silent in a stock debug build and only appear once Amethyst.VERBOSE_LOGS is flipped to true. RelayUsageListener already documents this correctly ("a debug build defaults to LogLevel.INFO"); these two had drifted from it. --- .../amethyst/service/playback/PlaybackDiag.kt | 10 +++++++--- .../composable/controls/VideoQualityControls.kt | 8 +++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/playback/PlaybackDiag.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/playback/PlaybackDiag.kt index c6cd9c9085..ac5c018225 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/playback/PlaybackDiag.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/playback/PlaybackDiag.kt @@ -22,9 +22,13 @@ package com.vitorpamplona.amethyst.service.playback /** * Shared logcat tag for the playback diagnostic trace (source routing, player lifecycle, error - * recovery, HLS liveness learning). Emitted with `Log.d`, so it appears only in a debug build - * (`Log.minLevel = DEBUG`) and is silent in benchmark/release (`ERROR`). To capture a playback - * investigation, install a debug build and run: + * recovery, HLS liveness learning). + * + * Emitted with `Log.d`, which fires only while `Log.minLevel <= DEBUG`. No shipped variant is + * there by default: [com.vitorpamplona.amethyst.Amethyst.DEFAULT_LOG_LEVEL] gives debug AND + * benchmark builds `INFO` (the `benchmark` build type counts as `isDebug`) and release `WARN`, so + * this trace is silent everywhere until `Amethyst.VERBOSE_LOGS` is flipped to true. To capture a + * playback investigation, set that flag, install a debug build and run: * * ``` * adb logcat -s PlaybackDiag diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/playback/composable/controls/VideoQualityControls.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/playback/composable/controls/VideoQualityControls.kt index dbc3491464..8acee68d0a 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/playback/composable/controls/VideoQualityControls.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/playback/composable/controls/VideoQualityControls.kt @@ -148,9 +148,11 @@ const val VIDEO_QUALITY_TAG = "VideoQuality" * Traces which rendition adaptive selection landed on, against the full ladder the manifest * offered. * - * The listener is registered only when the trace can actually be emitted — debug builds set - * `Log.minLevel = DEBUG` while benchmark/release set `ERROR` (see [PLAYBACK_DIAG_TAG]) — so the - * release path keeps the "no listener per player" property that dropping the old selector bought. + * The listener is registered only when the trace can actually be emitted. `Log.minLevel` is above + * `DEBUG` in every variant by default — `INFO` for debug and benchmark builds, `WARN` for release + * (see [PLAYBACK_DIAG_TAG]) — so this costs nothing until `Amethyst.VERBOSE_LOGS` is turned on, + * and every build keeps the "no listener per player" property that dropping the old selector + * bought. */ @Composable fun LogVideoQualitySelection(player: Player) {