-
Notifications
You must be signed in to change notification settings - Fork 214
Fix Eager Conflict Resolution Deadlock and Improve Mutable Store Code Quality #679
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| package org.mobilenativefoundation.store.store5 | ||
|
|
||
| /** | ||
| * A simple logging interface for logging error and debug messages. | ||
| */ | ||
| interface Logger { | ||
| /** | ||
| * Logs an error message, optionally with a throwable. | ||
| * | ||
| * @param message The error message to log. | ||
| * @param throwable An optional [Throwable] associated with the error. | ||
| */ | ||
| fun error( | ||
| message: String, | ||
| throwable: Throwable? = null, | ||
| ) | ||
|
|
||
| /** | ||
| * Logs a debug message. | ||
| * | ||
| * @param message The debug message to log. | ||
| */ | ||
| fun debug(message: String) | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no info?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're not currently using info and this component isn't currently being exposed to the consumer. There's an open request to improve logging #638. My plan is to replace this then with logging hooks delegated to the user |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package org.mobilenativefoundation.store.store5.impl | ||
|
|
||
| import co.touchlab.kermit.CommonWriter | ||
| import org.mobilenativefoundation.store.store5.Logger | ||
|
|
||
| /** | ||
| * Default implementation of [Logger] using the Kermit logging library. | ||
| */ | ||
| internal class DefaultLogger : Logger { | ||
| private val delegate = | ||
| co.touchlab.kermit.Logger.apply { | ||
| setLogWriters(listOf(CommonWriter())) | ||
| setTag("Store") | ||
| } | ||
|
|
||
| override fun debug(message: String) { | ||
| delegate.d(message) | ||
| } | ||
|
|
||
| override fun error( | ||
| message: String, | ||
| throwable: Throwable?, | ||
| ) { | ||
| delegate.e(message, throwable) | ||
|
Check warning on line 24 in store/src/commonMain/kotlin/org/mobilenativefoundation/store/store5/impl/DefaultLogger.kt
|
||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.