Skip to content

feat: reduced IO logger #4078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open

Conversation

MohamadJaara
Copy link
Member


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

the current LogFileWriter have some short comming

  1. it start a new new file writer for each line
  2. it flushes each log line directly into storage creating

Solutions

  1. create a new async logger
  2. buffer log lines and flushes with a set interval
  3. since the logger is now async add a crash handler to make sure crashes are logged
  4. also when the app start check if there are any oom or ANRs from the previous app start
  5. have a dedicated process that listens to logcat
  6. keep the old logger as it is and enable the new one only in internal builds

Needs releases with:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.

Notes (Optional)

Specify here any other facts that you think are important for this issue.

Attachments (Optional)

Attachments like images, videos, etc. (drag and drop in the text box)


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@MohamadJaara MohamadJaara changed the title Mo/feat/thred safe logging feat: reduced IO logger Jun 23, 2025
Copy link

codecov bot commented Jun 23, 2025

Codecov Report

Attention: Patch coverage is 0% with 229 lines in your changes missing coverage. Please review.

Project coverage is 47.18%. Comparing base (2127685) to head (0c1cc7d).

Files with missing lines Patch % Lines
...m/wire/android/util/logging/LogFileWriterV2Impl.kt 0.00% 181 Missing ⚠️
...rc/main/kotlin/com/wire/android/WireApplication.kt 0.00% 35 Missing ⚠️
...wire/android/util/logging/LogFileWriterV2Config.kt 0.00% 7 Missing ⚠️
...m/wire/android/util/logging/LogFileWriterV1Impl.kt 0.00% 3 Missing ⚠️
...in/com/wire/android/ui/debug/UserDebugViewModel.kt 0.00% 2 Missing ⚠️
...lin/com/wire/android/util/logging/LogFileWriter.kt 0.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4078      +/-   ##
===========================================
- Coverage    47.78%   47.18%   -0.61%     
===========================================
  Files          502      505       +3     
  Lines        17571    17797     +226     
  Branches      2901     2930      +29     
===========================================
  Hits          8397     8397              
- Misses        8292     8518     +226     
  Partials       882      882              
Files with missing lines Coverage Δ
...re/android/notification/WireNotificationManager.kt 81.54% <ø> (ø)
...in/kotlin/com/wire/android/services/CallService.kt 11.25% <ø> (ø)
...in/kotlin/com/wire/android/util/logging/LogUtil.kt 0.00% <ø> (ø)
...lin/com/wire/android/util/logging/LogFileWriter.kt 0.00% <0.00%> (ø)
...in/com/wire/android/ui/debug/UserDebugViewModel.kt 0.00% <0.00%> (ø)
...m/wire/android/util/logging/LogFileWriterV1Impl.kt 0.00% <0.00%> (ø)
...wire/android/util/logging/LogFileWriterV2Config.kt 0.00% <0.00%> (ø)
...rc/main/kotlin/com/wire/android/WireApplication.kt 0.00% <0.00%> (ø)
...m/wire/android/util/logging/LogFileWriterV2Impl.kt 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2127685...0c1cc7d. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Copy link
Contributor

Built wire-android-staging-compat-pr-4078.apk is available for download

Copy link
Contributor

Built wire-android-dev-debug-pr-4078.apk is available for download

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