Feature/1376/logging and reporting#6373
Draft
mahibi wants to merge 1 commit into
Draft
Conversation
Contributor
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/27824399768/artifacts/7749295330 |
Contributor
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/27842498569/artifacts/7756417285 |
Logs are written to rotating files on-device and shown in a Logs screen.
They are attached to a crash screen on unhandled exceptions, and exported by email or ZIP.
Logger
- LoggerImpl: async, queue-based file logger writing logcat threadtime
format to filesDir/logs/nc_talk_log.txt with rotation (3 backups)
- LogEntry: serialises/deserialises the threadtime format; parseLines()
groups consecutive same-header lines back into one multi-line entry
- LoggingHttpInterceptor: buffers per-request OkHttp lines into a single
LogEntry so each HTTP exchange appears as one expandable row
- Logger injected into BaseActivity and via Dagger for constructor use;
minimum level configurable at runtime (WARNING by default)
Logs screen (LogsActivity)
- Scrollable list of LogEntry rows with colour-coded level indicator;
multi-line entries (stack traces, HTTP bodies) expand on tap
- Menu: send as mail (email-only chooser, pre-filled android@nextcloud.com),
download as ZIP (file picker via CreateDocument), toggle advanced
logging, delete all logs
- Privacy warning always visible at the top
Crash screen (ShowErrorActivity, isolated :crash process)
- ExceptionHandler catches uncaught exceptions, flushes the log,
attaches the last 200 log lines + diagnosis report + stack trace, and
starts ShowErrorActivity before forwarding to the default handler so
Play Console still records the crash
- Same send-as-mail / download-as-ZIP menu as the Logs screen
Sharing / export
- shareLogsAndDiagnosis(): email intent with log JSON attached;
mailto: selector restricts chooser to mail apps only
- saveLogsAsZip(): writes nc_talk_log_export.json + diagnosis.md into
a ZIP stream for the SAF CreateDocument flow
- Log files converted to Android Studio logcat JSON format at export
time so the file can be imported directly into the AS logcat panel
Diagnosis report
- DiagnosisReport extracted from DiagnosisActivity into a shared
buildDiagnosisElements() function reused by the crash screen and the
Logs share flow; DiagnosisActivity now delegates to it.
AI-assistant: 2.1.183 (Claude Code) (Claude Sonnet 4.6)
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
07d836e to
0faa80f
Compare
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.
WIP
This PR will add:
🖼️ Screenshots
🚧 TODO
🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)