From 96d8678dd3632486abc02be816bd8bd6cf99e83a Mon Sep 17 00:00:00 2001 From: The412Banner Date: Thu, 8 Oct 2026 21:21:03 -0400 Subject: [PATCH] Stores: the stores log lives under filesDir/logs/stores Beside the session folders, where every log is headed, so the log share and the stores agree on one place. --- .../main/java/com/droiddeck/launcher/stores/StoreLogFiles.kt | 5 +++-- docs/development/stores.md | 2 +- docs/progress-log.md | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/droiddeck/launcher/stores/StoreLogFiles.kt b/app/src/main/java/com/droiddeck/launcher/stores/StoreLogFiles.kt index f74188ebe..0791df3d1 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/StoreLogFiles.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/StoreLogFiles.kt @@ -9,7 +9,8 @@ import java.util.Locale import java.util.concurrent.Executors /** - * The stores' log on disk, app-private: `filesDir/stores/logs/stores-.log`, one file a + * The stores' log on disk, app-private: `filesDir/logs/stores/stores-.log` (beside the + * session folders, where every log lives), one file a * day, the last [KEEP_DAYS] kept, each capped near [MAX_BYTES] (the full one moves to `.1`). Lines * arrive already redacted ([StoreLog.redactLine]). Written on one background thread, in order. The * session's Share logs zip carries these files, so they can be attached to a report when asked. @@ -22,7 +23,7 @@ object StoreLogFiles { private val NAME = Regex("""stores-(\d{4}-\d{2}-\d{2})\.log(\.1)?""") private val writer = Executors.newSingleThreadExecutor { r -> Thread(r, "store-log").apply { isDaemon = true } } - fun dir(context: Context): File = File(context.applicationContext.filesDir, "stores/logs") + fun dir(context: Context): File = File(context.applicationContext.filesDir, "logs/stores") /** Appends one stamped line to today's file. Any thread. */ fun append(context: Context, line: String) { diff --git a/docs/development/stores.md b/docs/development/stores.md index f3053bd8c..a6013fdbf 100644 --- a/docs/development/stores.md +++ b/docs/development/stores.md @@ -114,7 +114,7 @@ each manager runs its Java fetch loop. | Install to (last pick, dialog default only) | `SessionPrefs.storesInstallTarget` | the Install dialog | Store log lines (the engines' included) go through `StoresState.logLine`, which redacts them -(`StoreLog.redactLine`) and writes them to logcat and to `filesDir/stores/logs/stores-.log` +(`StoreLog.redactLine`) and writes them to logcat and to `filesDir/logs/stores/stores-.log` (`StoreLogFiles`: one file a day, seven days kept, ~2 MB each before it rolls to `.1`). Nothing shows them in the app; the session's Share logs zip carries them under `stores/`. diff --git a/docs/progress-log.md b/docs/progress-log.md index ca26ffea2..9863c6891 100644 --- a/docs/progress-log.md +++ b/docs/progress-log.md @@ -136,7 +136,7 @@ without it and Setup says "Stores engine not built"). A thin bar over the art while downloading. Install, Resume, Uninstall, Get and Buy live on the game page; A on a card opens it. - **No log panel:** the Downloads page's engine log is gone. Store lines go to logcat and to - app-private daily files (`filesDir/stores/logs/stores-.log`, seven days, ~2 MB rolling to + app-private daily files (`filesDir/logs/stores/stores-.log`, seven days, ~2 MB rolling to `.1`), pruned as the app starts; the session's Share logs zip includes them under `stores/`. - **Store log lines are redacted at the one choke point** (`StoresState.logLine`, which the engines' lines reach too): every URL is cut to scheme, host and a plain first path segment (a GOG secure