-
Notifications
You must be signed in to change notification settings - Fork 5
Configurable Logging #34
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.
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
I'm in favor of making the loggers customizable, but I'm wondering why we're adding our own interfaces here instead of e.g. using https://github.com/apple/swift-log? We have to write a bridge from Kermit to something either way, so why not something that has an existing ecosystem with plenty of writer implementations around it? Do we need features that library doesn't support?
That's a fair point. My thinking here was to introduce a minimal interface with zero package dependencies. This keeps the core package lightweight and flexible. Users can opt for the default |
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.
I see 👍 In my humble opinion, using swift-log
would make things easier for our users out of the box and reduce the code we have to write around defining logger APIs and printing to OSLog
. But I understand the desire to not introduce dependencies either, and this approach looks good to me as well.
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.
LGTM 👍
Overview
This adds the ability to specify a
logger
when creating a PowerSync database. The minimum log severity can be configured when creating aDefaultLogger
.Loggers also have the ability to specify custom
LogWriter
s which can transport logs to custom sinks.The implementation here declares a Swift logging interface and maps this to a Kotlin Kermit logger which is used internally.