Min sdk binary reader coroutines deduplicate logcat reader#2
Conversation
commit 94909ffa69a9e3fccd344e8e501052e08c51628f from https://github.com/brudaswen/android-logcat.git goal use LogcatBinaryParser in logcatviewer
…ble with kotlin 1.9
Summary of ChangesHello @evermind-zz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors and modernizes the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request is a significant and valuable refactoring. It successfully modernizes the codebase by introducing Kotlin coroutines and flows for asynchronous log reading, replacing the old thread-based implementation. The switch to parsing binary logcat data via LogcatBinaryParser is a great improvement for efficiency. Deduplicating the log reading logic into the new LogcatReader class greatly improves maintainability and cleans up the Activity and Service. The addition of a customizable log export format is also a nice feature. While the changes are excellent overall, I've identified a few critical issues that could lead to crashes, along with some suggestions to further improve performance and code quality.
src/main/java/de/brudaswen/android/logcat/core/parser/LogcatBinaryParser.kt
Outdated
Show resolved
Hide resolved
* have one common place for all export log file * convert from object to class * remove duplicated code
* use coroutines instead of threads * deduplicate code * LogcatAdapter: replace append() with appendList()
avoid creating new object for every LogItem
…he filename prefix
e0bf029 to
fdde393
Compare
This is no real PR. I just have some changes that might be worth upstreaming but first I want to make sure you are interested at all. My goals were: