thunderbird / thunderbird/thunderbird-android

Improving K-9 Logging

Open
#1,732 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: architecture type: enhancement
Dominant language
Kotlin
Stars
14k
Forks
2.8k
Avg merge
3d 3h
Merged PRs (30d)
57

Description

Expected behavior

Users should easily be able to report issues, with enough detail to allow us to debug them.

Actual behavior

We get issues opened with little to no information. The recommended way to diagnose problems involves (for all recent Android devices) connecting to adb. This essentially restricts bug reports to Android developers only.

Problems arising

In a normal app which is funded by a development team, you'd use something like ACRA which then pumps data to a back-end server. K-9 doesn't have this option. It's an open source project, there's no hosting or funding available for that kind of solution.

Often the bugs we see are not crashes per see, which are fairly straightforward to solve, but instead Doze / data usage related.

Possible solution 1 - Save logcat output

The reason we can't recommend aLogCat is because it no longer has access to our logs. Therefore we must read the logs ourselves. Obviously if we crash just reading them is insufficient. So we also have to write them to a file.

One option is to implement a rolling logging solution. This would:

  • Run logcat on the device in our process. It turns out this is fairly straightforward, if rather ugly:

http://www.journal.deviantdev.com/android-log-logcat-to-file-while-runtime/

  • Periodically roll the log file. We don't want to take up too much space. This could be a configurable option - users with complex problems could increase the amount stored.
  • Allow the user to save logs to external storage

Our issue form would then say:

Upload the the latest log file from K-9's directory on your phone.

We need to carefully test this to make sure that the background logging itself doesn't cause any issues.

Possible solution 2 - Stop using android.util.Log

The alternative is more drastic. We implement a new logging architecture. This would give us full control - we could flush to disk periodically (and when getting an uncaught exception) rather than all the time.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the two proposed approaches: saving rolling logcat output or replacing android.util.Log, including how logs would be saved and shared. The issue names no files or tests; done requires selecting and implementing an approach that improves diagnostic detail without introducing background logging problems.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile, observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.