Skip to content

Feature/1376/logging and reporting#6373

Draft
mahibi wants to merge 1 commit into
masterfrom
feature/1376/loggingAndReporting
Draft

Feature/1376/logging and reporting#6373
mahibi wants to merge 1 commit into
masterfrom
feature/1376/loggingAndReporting

Conversation

@mahibi

@mahibi mahibi commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

This PR will add:

  • file logging
  • view logfiles in settings
  • option to enable advanced logging (Level.DEBUG) or disable advanced logging (Level.WARNING)
  • crash screen to catch unhandled exceptions
  • Share logfile / crash report via email or download as ZIP file

🖼️ Screenshots

Logs screen

grafik grafik grafik

Crash reporting screen

grafik

Testing

To test the crash screen, just add

throw RuntimeException("Test crash")

somewhere in the code and trigger it.

🚧 TODO

  • set predefined mail address by configs
  • create own email address for talk android
    • set it as predefined mail

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@mahibi mahibi self-assigned this Jun 19, 2026
@mahibi mahibi added the 2. developing Work in progress label Jun 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

APK file: https://github.com/nextcloud/talk-android/actions/runs/27824399768/artifacts/7749295330
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

@github-actions

Copy link
Copy Markdown
Contributor

APK file: https://github.com/nextcloud/talk-android/actions/runs/27842498569/artifacts/7756417285
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

@mahibi mahibi force-pushed the feature/1376/loggingAndReporting branch 2 times, most recently from 0faa80f to 2bff679 Compare June 22, 2026 09:42
  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 color-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>
@mahibi mahibi force-pushed the feature/1376/loggingAndReporting branch from 2bff679 to 141de3f Compare June 22, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant