Skip to content
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

Switch to the Kermit logging library #517

Merged
merged 13 commits into from
Feb 13, 2024
Merged

Switch to the Kermit logging library #517

merged 13 commits into from
Feb 13, 2024

Conversation

dpad85
Copy link
Member

@dpad85 dpad85 commented Feb 13, 2024

This PR switches the logging utility from kodein-log to kermit. See ACINQ/lightning-kmp#593 for the similar changes in lightning-kmp.

Writing logs to file

With the upgrade to Kotlin 1.9, we removed the previous implementation that wrote logs to file. It was done in the shared module, and used kodein-memory to access and write logs to files. We now delegate that to the application layer, either swift-log (using FileLogger) on iOS or slf4j on Android.

iOS

There are two issues with OSLog (new Apple logging system) which prevents us from using it:

So for now, we use swift-log, configured with FileLogger. See PassthruLogWriter.

Android

Logs are sent to slf4j through the Slf4jLogWriter. Slf4j is configured in phoenix-android to send log to LogCat (android logs) and to write to file (with a rolling policy).

@dpad85 dpad85 marked this pull request as ready for review February 13, 2024 17:09
@dpad85 dpad85 requested a review from robbiehanson February 13, 2024 17:09
@dpad85 dpad85 merged commit fd3c2a4 into master Feb 13, 2024
@dpad85 dpad85 deleted the kermit-rebased branch February 13, 2024 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants