fix(bionic): put the game's logs where Share logs finds them

Shared session logs never held DroidDeck-Bionic's own log or its
graphics logs. launch.sh wrote them into the game's prefix, which Share
logs does not read, and dropped the log locations Detailed graphics logs
sets along with the rest of the guest environment.

- proton: names a game launch's folder in the session folder (the
  game's log folder when Detailed graphics logs made one, else
  games/<date>-bionic-<appid>) and passes the graphics log locations as
  Android paths.
- launch.sh: writes the game's log into that folder; the prefix's
  droiddeck-bionic.log points to it, since Share logs takes only files
  with one name. Keeps DXVK_LOG_PATH, VKD3D_LOG_FILE and MESA_LOG_FILE.
- EnhancedSessionLogShare: keeps the name droiddeck-bionic.log and
  files it with the games.
This commit is contained in:
The412Banner committed 2026-11-23 01:32:33 +00:00
1 parent f17d3ddaad
commit 49381484dd
5 files changed
+127 -6

No files matched your search

@@ -937,7 +937,7 @@ internal object EnhancedSessionLogShare {
val value = entry.lowercase(Locale.US)
if (value.startsWith("battlenet/") || value.startsWith("stores/") || value.startsWith("tools/") ||
value.contains("droiddeck-esync/") || GAME_LOG.matches(value.substringAfterLast('/')) ||
listOf("proton", "wine", "dxvk", "vkd3d", "battle.net", "game-debug").any(value::contains)) return Category.GAMES
listOf("proton", "wine", "dxvk", "vkd3d", "battle.net", "game-debug", "bionic").any(value::contains)) return Category.GAMES
if (listOf("wayland", "gamescope", "xwayland", "vulkan", "gpu", "mesa", "egl", "glx", "drm", "compositor", "frame-trace").any(value::contains)) return Category.GRAPHICS
return Category.SESSION
}
@@ -948,7 +948,7 @@ internal object EnhancedSessionLogShare {
"droiddeck", "droiddeck-esync", "session.log", "app.log", "wayland.log", "audio.log",
"device.txt", "network.txt", "events.jsonl", "memory.csv", "capture.json", "crash.log",
"frame-trace.log", "process-trace.log", "game-lifecycle.log", "launches.log", "tools.tsv", "wanted.tsv", "prefixes.json",
"battlenet.log", "spawned.log", "flatpak-install.log", "cef_log.txt", "cef_log.previous.txt",
"battlenet.log", "spawned.log", "flatpak-install.log", "cef_log.txt", "cef_log.previous.txt", "droiddeck-bionic.log",
"console_log.txt", "webhelper_js.txt", "controller_support.txt", "systemperfmanager.txt",
)
private val KNOWN_COMPONENT_PATTERNS = listOf(
@@ -98,6 +98,22 @@ class EnhancedSessionLogShareTest {
SessionLogShare.clear(app)
}
@Test fun aBionicGameLogIsSharedWithTheGamesUnderItsName() {
val session = tmp.newFolder("2026-11-22-09-steam")
session.resolve("session.log").writeText("startup ok\n")
val launch = session.resolve("games/2026-11-22-201105-bionic-341940").apply { mkdirs() }
launch.resolve("droiddeck-bionic.log").writeText("20:11:05 waitforexitandrun Hatred.exe\n")
val games = EnhancedSessionLogShare.create(app, session).single { it.name.endsWith("-games.zip") }
ZipFile(games).use { archive ->
val entry = archive.getEntry("${session.name}/games/2026-11-22-201105-bionic-341940/droiddeck-bionic.log")
assertTrue(entry != null)
assertEquals("20:11:05 waitforexitandrun Hatred.exe\n", archive.getInputStream(entry).bufferedReader().readText())
}
SessionLogShare.clear(app)
}
@Test fun oversizedFilesKeepBoundedBeginningAndTailAndDeclareTruncation() {
val session = tmp.newFolder("2026-11-04-02-game")
session.resolve("steam-7.log").writeText("begin\n" + "middle\n".repeat(100) + "tail\n")