feat(logging): add platform-independent file logging [WPB-26806]#5062
feat(logging): add platform-independent file logging [WPB-26806]#5062MohamadJaara wants to merge 4 commits into
Conversation
Ups 🫰🟨This PR is too big. Please try to break it up into smaller PRs. |
…compression improvements
| const val MILLIS_SUFFIX_LENGTH = 4 | ||
| const val HUNDRED_MILLIS = 100 | ||
| const val TEN_MILLIS = 10 | ||
| } |
There was a problem hiding this comment.
this part need carfull review in case i missed something
it does call System::currentTimeMillis and cache the the prefix and for each log line calculate only the ms
meaning the parsing for the full date is only one time per second and the rest only MS is added to the end
the next second it will parsed again
if there is a better and more efficient way to do so let me know
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (75.25%) 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 #5062 +/- ##
===========================================
+ Coverage 49.44% 49.98% +0.54%
===========================================
Files 655 659 +4
Lines 23703 23980 +277
Branches 3659 3705 +46
===========================================
+ Hits 11720 11987 +267
+ Misses 10889 10870 -19
- Partials 1094 1123 +29
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
https://wearezeta.atlassian.net/browse/WPB-26806
Add a file logger that does not depend on Android Logcat.
On some devices, Logcat is disabled or unavailable. The previous log collection flow could therefore produce empty
0 Bfiles, leaving support teams without useful diagnostic information.How to reproduce
What changed
USE_PLATFORM_INDEPENDENT_FILE_LOGGERfor controlled rollout.Logging flow
flowchart LR App["Application logs"] --> Kermit["Kermit"] Kalium["Kalium logs"] --> Kermit AVS["AVS native callback"] --> Kalium CoreCrypto["CoreCrypto native callback"] --> Kalium Kermit --> Writer["Platform-independent file writer"] Writer --> Active["Active log file"] Active --> Rotation["Rotation and gzip compression"] Rotation --> Export["Diagnostic log export"]Result
Diagnostic log files no longer rely on Logcat being available. Devices with restricted or disabled Logcat can still produce useful application and supported native-library logs.
Notes
WARN.