refactor(logging): Reduce log noise by lowering severity of common errors (#4591)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2026-02-18 15:16:11 -06:00 committed by GitHub
parent 7ffbbd6113
commit f012e3818d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 91 additions and 56 deletions

View file

@ -17,6 +17,7 @@
package org.meshtastic.core.service
import co.touchlab.kermit.Logger
import co.touchlab.kermit.Severity
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
@ -65,7 +66,7 @@ class ServiceRepository @Inject constructor() {
get() = _clientNotification
fun setClientNotification(notification: ClientNotification?) {
Logger.e { notification?.message.orEmpty() }
notification?.message?.let { Logger.w { it } }
_clientNotification.value = notification
}
@ -78,8 +79,8 @@ class ServiceRepository @Inject constructor() {
val errorMessage: StateFlow<String?>
get() = _errorMessage
fun setErrorMessage(text: String) {
Logger.e { text }
fun setErrorMessage(text: String, severity: Severity = Severity.Error) {
Logger.log(severity, "ServiceRepository", null, text)
_errorMessage.value = text
}