-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
change darwin impl to delegate to os_log_t #348
Conversation
based on previous impl and https://blog.shipbook.io/ios-logs looks like a better approach will be to just delegate logs to the os logger.
@conradev following a refactoring around multiplatform I thought about simplifying darwin support. This PR is changing darwin to behave more similar to other platforms that delegate logging to the native system. Major changes are:
The code can be seen in I would really appreciate any thought about the revised impl. If console logging is something often used we can consider of a way to have both the new impl and console logging (with a config to pick which is used). But most other platforms that have clear native logging don't have that. |
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.
This overall approach looks great to me! I am glad that it is more standard for the library. I only started with console appender because that is what the existing macOS support used and I didn't want to rock the boat
I noted a small bug, but besides that it looks great!
src/darwinMain/kotlin/io/github/oshai/kotlinlogging/internal/KLoggerFactory.kt
Show resolved
Hide resolved
src/darwinMain/kotlin/io/github/oshai/kotlinlogging/DarwinKLogger.kt
Outdated
Show resolved
Hide resolved
Next up, you should consider defaulting to journalctl on Linux if it is present if you don't already |
Thanks for the quick review! Regarding linux, an initial contribution is welcome (mostly how to access the linux api) and I can take if from there if you would like. |
based on previous impl and https://blog.shipbook.io/ios-logs
looks like a better approach will be to just delegate logs to the os logger.