Deprecate throwable logging function, produces bad log
This commit is contained in:
parent
984956ce95
commit
ccdae6bb9a
@ -17,10 +17,15 @@ fun Any.xLog(logLevel: LogLevel, log: String) = xLog().log(logLevel.int, log)
|
||||
fun Any.xLogJson(log: String) = xLog().json(log)
|
||||
fun Any.xLogXML(log: String) = xLog().xml(log)
|
||||
|
||||
@Deprecated("Use proper throwable function", ReplaceWith("""xLogE("", log)"""))
|
||||
fun Any.xLogE(log: Throwable) = xLogStack().e(log)
|
||||
@Deprecated("Use proper throwable function", ReplaceWith("""xLogW("", log)"""))
|
||||
fun Any.xLogW(log: Throwable) = xLogStack().w(log)
|
||||
@Deprecated("Use proper throwable function", ReplaceWith("""xLogD("", log)"""))
|
||||
fun Any.xLogD(log: Throwable) = xLogStack().d(log)
|
||||
@Deprecated("Use proper throwable function", ReplaceWith("""xLogI("", log)"""))
|
||||
fun Any.xLogI(log: Throwable) = xLogStack().i(log)
|
||||
@Deprecated("Use proper throwable function", ReplaceWith("""xLog(logLevel, "", log)"""))
|
||||
fun Any.xLog(logLevel: LogLevel, log: Throwable) = xLogStack().log(logLevel.int, log)
|
||||
|
||||
fun Any.xLogE(log: String, e: Throwable) = xLogStack().e(log, e)
|
||||
|
@ -150,7 +150,7 @@ class ApiMangaParser(private val lang: String) {
|
||||
if (tags.isNotEmpty()) tags.clear()
|
||||
tags += genres.map { RaisedTag(null, it, MangaDexSearchMetadata.TAG_TYPE_DEFAULT) }
|
||||
} catch (e: Exception) {
|
||||
xLogE(e)
|
||||
xLogE("Parse into metadata error", e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
@ -250,13 +250,9 @@ class ApiMangaParser(private val lang: String) {
|
||||
|
||||
fun chapterParseForMangaId(response: Response): Int {
|
||||
try {
|
||||
if (response.code != 200) throw Exception("HTTP error ${response.code}")
|
||||
checkNotNull(response.body) {
|
||||
"Null Response"
|
||||
}
|
||||
return response.parseAs<ApiChapterSerializer>().data.mangaId
|
||||
} catch (e: Exception) {
|
||||
xLogE(e)
|
||||
xLogE("Parse for manga id error", e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ class SimilarUpdateService(
|
||||
// Unsubscribe from any previous subscription if needed.
|
||||
job?.cancel()
|
||||
val handler = CoroutineExceptionHandler { _, exception ->
|
||||
xLogE(exception)
|
||||
xLogE("Similar manga update error", exception)
|
||||
stopSelf(startId)
|
||||
showResultNotification(true)
|
||||
cancelProgressNotification()
|
||||
|
@ -56,7 +56,7 @@ class BatchAddPresenter : BasePresenter<BatchAddController>() {
|
||||
currentlyAddingRelay.call(STATE_INPUT_TO_PROGRESS)
|
||||
|
||||
val handler = CoroutineExceptionHandler { _, throwable ->
|
||||
xLogE(throwable)
|
||||
xLogE("Batch add error", throwable)
|
||||
}
|
||||
|
||||
presenterScope.launch(Dispatchers.IO + handler) {
|
||||
|
@ -187,7 +187,7 @@ class BrowserActionActivity : AppCompatActivity() {
|
||||
suspend fun captchaSolveFail() {
|
||||
currentLoopId = null
|
||||
validateCurrentLoopId = null
|
||||
xLogE(IllegalStateException("Captcha solve failure!"))
|
||||
xLogE("Captcha solve Error", IllegalStateException("Captcha solve failure!"))
|
||||
withUIContext {
|
||||
binding.webview.evaluateJavascript(SOLVE_UI_SCRIPT_HIDE, null)
|
||||
MaterialDialog(this@BrowserActionActivity)
|
||||
|
@ -20,6 +20,7 @@ import eu.kanade.tachiyomi.source.online.all.MangaDex
|
||||
import eu.kanade.tachiyomi.ui.base.controller.DialogController
|
||||
import eu.kanade.tachiyomi.util.lang.launchUI
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import exh.log.xLogW
|
||||
import exh.source.getMainSource
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@ -109,6 +110,7 @@ class MangadexLoginDialog(bundle: Bundle? = null) : DialogController(bundle) {
|
||||
}
|
||||
} catch (error: Exception) {
|
||||
errorResult()
|
||||
xLogW("Login to Mangadex error", error)
|
||||
error.message?.let { launchUI { binding.root.context.toast(it) } }
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user