Update dependency com.squareup.logcat:logcat to v0.2 (#2331)

* Update dependency com.squareup.logcat:logcat to v0.2

* Fix build

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FooIbar <118464521+FooIbar@users.noreply.github.com>
This commit is contained in:
renovate[bot]andFooIbar authored and GitHub committed 2025-05-19 04:02:24 +00:00
1 parent 7e0e01295f
commit dc4ea5e96d
6 files changed
+16 -9

No files matched your search

@@ -100,8 +100,13 @@ class EhApplication :
AppCompatDelegate.setDefaultNightMode(mode)
}
}
if (!LogcatLogger.isInstalled && Settings.saveCrashLog) {
LogcatLogger.install(AndroidLogcatLogger(LogPriority.VERBOSE))
LogcatLogger.loggers += AndroidLogcatLogger(LogPriority.VERBOSE)
Settings.saveCrashLog.valueFlow().collect {
if (it) {
LogcatLogger.install()
} else {
LogcatLogger.uninstall()
}
}
}
lifecycle.addObserver(lockObserver)
@@ -122,6 +122,7 @@ object Settings : DataStorePreferences(null) {
val showGalleryPages = boolPref("show_gallery_pages", true)
val qSSaveProgress = boolPref("qs_save_progress", true)
val security = boolPref("require_unlock", false)
val saveCrashLog = boolPref("save_crash_log", true)
val animateItems = boolPref("animate_items", true)
val enableCronet = boolPref("enable_cronet", true)
val enableQuic = boolPref("enable_quic", true)
@@ -159,7 +160,6 @@ object Settings : DataStorePreferences(null) {
var mediaScan by boolPref("media_scan", false).observed { updateWhenKeepMediaStatusChanges() }
var hasDefaultDownloadLabel by boolPref("has_default_download_label", false)
var saveParseErrorBody by boolPref("save_parse_error_body", true)
var saveCrashLog by boolPref("save_crash_log", true)
var removeImageFiles by boolPref("include_pic", true)
var harmonizeCategoryColor by boolPref("harmonize_category_color", true)
var preloadThumbAggressively by boolPref("preload_thumb_aggressively", false)
@@ -120,10 +120,12 @@ fun AnimatedVisibilityScope.AdvancedScreen(navigator: DestinationsNavigator) = S
}
}
}
SwitchPreference(
var saveCrashLog by Settings.saveCrashLog.asMutableState()
SwitchPref(
checked = saveCrashLog,
onMutate = { saveCrashLog = !saveCrashLog },
title = stringResource(id = R.string.settings_advanced_save_crash_log),
summary = stringResource(id = R.string.settings_advanced_save_crash_log_summary),
value = Settings::saveCrashLog,
)
val dumpLogError = stringResource(id = R.string.settings_advanced_dump_logcat_failed)
LauncherPreference(
@@ -19,7 +19,7 @@ object CrashHandler {
fun install() {
val handler = Thread.getDefaultUncaughtExceptionHandler()
Thread.setDefaultUncaughtExceptionHandler { t, e ->
if (Settings.saveCrashLog) {
if (Settings.saveCrashLog.value) {
runCatching { saveCrashLog(e) }
}
handler?.uncaughtException(t, e)
@@ -4,11 +4,11 @@ import logcat.LogPriority
import logcat.asLog
import logcat.logcat as logcatImpl
inline fun logcat(tag: String, priority: LogPriority = LogPriority.DEBUG, message: () -> String) {
inline fun logcat(tag: String, priority: LogPriority = LogPriority.DEBUG, crossinline message: () -> String) {
logcatImpl(tag, priority, message)
}
inline fun Any.logcat(priority: LogPriority = LogPriority.DEBUG, message: () -> String) {
inline fun Any.logcat(priority: LogPriority = LogPriority.DEBUG, crossinline message: () -> String) {
logcatImpl(priority, message = message)
}
+1 -1
View File
@@ -98,7 +98,7 @@ okhttp-bom = { module = "com.squareup.okhttp3:okhttp-bom", version.ref = "okhttp
okhttp-android = { module = "com.squareup.okhttp3:okhttp-android" }
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
logcat = "com.squareup.logcat:logcat:0.1"
logcat = "com.squareup.logcat:logcat:0.2"
okio-jvm = { module = "com.squareup.okio:okio-jvm", version.ref = "okio" }