mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-28 12:30:12 +02:00
fix(common/logger): crash
This commit is contained in:
parent
ea8723d990
commit
1383686a82
@ -207,7 +207,7 @@ class LogManager(
|
||||
dateTime = getCurrentDateTime(),
|
||||
tag = tag,
|
||||
message = message.toString().let {
|
||||
if (anonymizeLogs)
|
||||
if (remoteSideContext.config.isInitialized() && anonymizeLogs)
|
||||
it.replace(Regex("[0-9a-f]{8}-[0-9a-f]{4}-{3}[0-9a-f]{12}", RegexOption.MULTILINE), "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
|
||||
else it
|
||||
}
|
||||
@ -217,7 +217,7 @@ class LogManager(
|
||||
Log.println(logLevel.priority, tag, message.toString())
|
||||
}.onFailure {
|
||||
Log.println(Log.ERROR, tag, "Failed to log message: $message")
|
||||
Log.println(Log.ERROR, tag, it.toString())
|
||||
Log.println(Log.ERROR, tag, it.stackTraceToString())
|
||||
}
|
||||
}
|
||||
}
|
@ -26,6 +26,8 @@ class ModConfig(
|
||||
lateinit var root: RootConfig
|
||||
private set
|
||||
|
||||
fun isInitialized() = ::root.isInitialized
|
||||
|
||||
private fun createRootConfig() = RootConfig().apply { lateInit(context) }
|
||||
|
||||
private fun load() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user