Skip to content

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

❌ Patch coverage is 0% with 227 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.15%. Comparing base (ec84f31) to head (83c91d4).

Files with missing lines Patch % Lines
...m/wire/android/util/logging/LogFileWriterV2Impl.kt 0.00% 179 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.74%   47.15%   -0.59%     
===========================================
  Files          525      528       +3     
  Lines        17918    18142     +224     
  Branches      2950     2979      +29     
===========================================
  Hits          8555     8555              
- Misses        8481     8705     +224     
  Partials       882      882              
Files with missing lines Coverage Δ
...re/android/notification/WireNotificationManager.kt 80.26% <ø> (ø)
...in/com/wire/android/services/CallServiceManager.kt 93.44% <ø> (ø)
...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 ec84f31...83c91d4. 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
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

@MohamadJaara MohamadJaara changed the title feat: reduced IO logger feat: optimized IO file logger Jul 7, 2025
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

Copy link
Contributor

This PR is stale because it has been open 30 days with no activity. Please update it or close it in case is not relevant anymore.

@github-actions github-actions bot added the stale Inactivity alert label Aug 18, 2025
# Conflicts:
#	app/src/androidTest/kotlin/com/wire/android/ui/debug/DebugScreenComposeTest.kt
#	app/src/main/kotlin/com/wire/android/services/CallService.kt
@stale stale bot removed the stale Inactivity alert label Aug 20, 2025
# Conflicts:
#	app/src/main/kotlin/com/wire/android/ui/debug/DebugScreen.kt
#	buildSrc/src/main/kotlin/customization/FeatureConfigs.kt
#	default.json
Copy link
Contributor

@yamilmedina yamilmedina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, gave a few suggestions about resource closure and a couple of questions.

@MohamadJaara MohamadJaara force-pushed the mo/feat/thred-safe-logging branch from afc0c1a to e6cc9de Compare October 8, 2025 09:34
Copy link

sonarqubecloud bot commented Oct 8, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
8.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link
Contributor

@yamilmedina yamilmedina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

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.

2 participants