fix: enable in-app sync logging (log2File init, INFO/NOTICE capture, log-level conflict)#411
Open
7MS8 wants to merge 3 commits into
Open
fix: enable in-app sync logging (log2File init, INFO/NOTICE capture, log-level conflict)#4117MS8 wants to merge 3 commits into
7MS8 wants to merge 3 commits into
Conversation
log2File was declared but never assigned, so log2File?.log() was always a no-op even when logging was enabled. Initialize it in doWork() when logging is enabled. Also add null guard in Log2File for cases where getExternalFilesDir() returns null (e.g. on GrapheneOS). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
rclone was running at default log level (WARNING), so INFO messages like per-file operations and "There was nothing to transfer" were never visible. Added --log-level INFO to sync command and collect rclone INFO lines into a single SyncLog entry per sync run. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
--log-level INFO was always added, but conflicts with -vvv (added when debug logging is enabled), causing rclone to exit immediately with "Can't set -v and --log-level" -- the sync silently does nothing. Only add --log-level/--stats-log-level when verbose logging is off. Also capture NOTICE-level rclone output (transfer stats) and include it alongside INFO messages in the in-app sync log entry. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8 tasks
|
This is another very useful fix. As described in issue #407, filesystem permission errors caused rclone to skip remote deletions, while Round Sync reported “There was nothing to do” and did not expose the underlying errors. I have not tested this PR yet, but I can confirm the logging bug, as I encountered it while investigating #407. My PR #414 fixes the task result and notification handling and persists relevant warning/error lines. This PR complements it by fixing the separate rclone log explicitly enabled in the app settings, including its initialization and INFO/NOTICE capture. There is some overlap in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out of #406 per reviewer request (separate unrelated fixes into their own PRs). This bundles the sync-logging pipeline fixes together since they're one coherent feature evolution — splitting the log-level fix out on its own would leave an intermediate state that crashes (see below), which is the same pattern the reviewer already flagged for the SFTP PR.
Bugs
log2Filenever initialized.log2File: Log2File? = nullinSyncWorker.kt/EphemeralWorker.ktwas declared but never assigned, solog2File?.log()was always a no-op even with "Use Logs" enabled —logs/log.txtstayed empty. Also added a null guard inLog2FileforgetExternalFilesDir()returning null (observed on GrapheneOS).--log-level INFOand collected INFO lines into the sync log entry.--log-level INFOunconditionally conflicts with-vvv(added when debug logging is enabled) — rclone exits immediately withCan't set -v and --log-level, and the sync silently does nothing. Fixed by only adding--log-level/--stats-log-levelwhen verbose logging is off.Reproduction
logs/log.txtstays empty regardless of sync outcome; the in-app sync log entry contains no per-file detail; if debug logging is on, sync fails silently with no useful log output at all (the-vvv/--log-levelcrash).logs/log.txtis populated for error-level rclone output, the sync log entry includes per-file INFO lines plus a final NOTICE transfer-stats line, and sync no longer crashes when debug logging is enabled.Test plan
./gradlew :app:compileOssDebugSources).logs/log.txtcaptures error-level output.