-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(paging): add logging warning on fail (#347)
- Loading branch information
Showing
7 changed files
with
36 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 7 additions & 5 deletions
12
instantsearch/src/androidMain/kotlin/com/algolia/instantsearch/extension/Console.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
package com.algolia.instantsearch.extension | ||
|
||
import android.util.Log | ||
import com.algolia.instantsearch.InternalInstantSearch | ||
|
||
internal actual object Console { | ||
@InternalInstantSearch | ||
public actual object Console { | ||
|
||
private const val Tag = "InstantSearch" | ||
|
||
actual fun debug(message: String, throwable: Throwable?) { | ||
public actual fun debug(message: String, throwable: Throwable?) { | ||
Log.d(Tag, message, throwable) | ||
} | ||
|
||
actual fun info(message: String, throwable: Throwable?) { | ||
public actual fun info(message: String, throwable: Throwable?) { | ||
Log.i(Tag, message, throwable) | ||
} | ||
|
||
actual fun warn(message: String, throwable: Throwable?) { | ||
public actual fun warn(message: String, throwable: Throwable?) { | ||
Log.w(Tag, message, throwable) | ||
} | ||
|
||
actual fun error(message: String, throwable: Throwable?) { | ||
public actual fun error(message: String, throwable: Throwable?) { | ||
Log.e(Tag, message, throwable) | ||
} | ||
} |
13 changes: 8 additions & 5 deletions
13
instantsearch/src/commonMain/kotlin/com/algolia/instantsearch/extension/Console.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
package com.algolia.instantsearch.extension | ||
|
||
internal expect object Console { | ||
import com.algolia.instantsearch.InternalInstantSearch | ||
|
||
fun debug(message: String, throwable: Throwable? = null) | ||
@InternalInstantSearch | ||
public expect object Console { | ||
|
||
fun info(message: String, throwable: Throwable? = null) | ||
public fun debug(message: String, throwable: Throwable? = null) | ||
|
||
fun warn(message: String, throwable: Throwable? = null) | ||
public fun info(message: String, throwable: Throwable? = null) | ||
|
||
fun error(message: String, throwable: Throwable? = null) | ||
public fun warn(message: String, throwable: Throwable? = null) | ||
|
||
public fun error(message: String, throwable: Throwable? = null) | ||
} |
14 changes: 7 additions & 7 deletions
14
instantsearch/src/jvmMain/kotlin/com/algolia/instantsearch/extension/Console.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
package com.algolia.instantsearch.extension | ||
|
||
import com.algolia.instantsearch.InternalInstantSearch | ||
import java.util.logging.Level | ||
import java.util.logging.Logger | ||
|
||
internal actual object Console { | ||
@InternalInstantSearch | ||
public actual object Console { | ||
|
||
private const val Tag = "InstantSearch" | ||
private val logger = Logger.getLogger(Console::class.qualifiedName) | ||
|
||
actual fun debug(message: String, throwable: Throwable?) { | ||
public actual fun debug(message: String, throwable: Throwable?) { | ||
logger.log(Level.FINE, message, throwable) | ||
} | ||
|
||
actual fun info(message: String, throwable: Throwable?) { | ||
public actual fun info(message: String, throwable: Throwable?) { | ||
logger.log(Level.INFO, message, throwable) | ||
} | ||
|
||
actual fun warn(message: String, throwable: Throwable?) { | ||
public actual fun warn(message: String, throwable: Throwable?) { | ||
logger.log(Level.WARNING, message, throwable) | ||
} | ||
|
||
actual fun error(message: String, throwable: Throwable?) { | ||
public actual fun error(message: String, throwable: Throwable?) { | ||
logger.log(Level.SEVERE, message, throwable) | ||
} | ||
|
||
} |