-
Notifications
You must be signed in to change notification settings - Fork 1
feat: stream ldk-node logs to android logcat #450
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements streaming of ldk-node logs to Android logcat while centralizing and unifying the logging architecture. The changes create a consistent log format that adopts ldk-node's logging pattern while making it compatible with Android log levels.
- Refactors the Logger from an object to a more flexible class-based architecture with dependency injection
- Implements LdkLogWriter to bridge ldk-node logs to Android logcat with proper log level mapping
- Centralizes log formatting and file management for both Bitkit and LDK logs
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Logger.kt | Complete refactor from object to class-based architecture with unified log formatting and LdkLogWriter implementation |
| LightningService.kt | Updates to use new LdkLogWriter instead of filesystem logging and improves error handling patterns |
| LogsRepo.kt | Moves LogSource enum to Logger.kt for centralized logging concerns |
| DateTime.kt | Adds utility function for UTC date formatters and LOG_LINE pattern for consistent timestamp formatting |
| Env.kt | Reorganizes ldkLogLevel declaration and fixes initialization order issue |
| ServiceQueue.kt | Adds LOG queue for dedicated logging thread management |
|
Really like the copilot summaries, though I wonder if it's able to generate them so nicely described if we no longer spend time to manually write relevant summary in the PR description. Worth a try though, it could save some valuable time... who knows 🤷🏻♂️. |
I guess it is done like this in blocktank repo |
c73aae0 to
81a7318
Compare
258c574 to
d6e639c
Compare
d6e639c to
b7d2941
Compare
|
@jvsena42 This PR should be ready for review now 🙏🏻 |
jvsena42
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested emulator -> check app and LDK Logs
Description
This PR adds the ldk-node logs to the android logcat and refactors to centralize the logging concerns and unify the log message format.
The logging format was adopted from ldk-node (source) with some small tweaks so it plays nice with both android log levels and the ldk-node ones.
note to reviewer : please merge only AFTER #449 .
Preview
QA Notes
Run in emulator, check logcat, expect ldk-node logs lines alongside the app logs in chronological order.