mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
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:
parent
7ffbbd6113
commit
f012e3818d
14 changed files with 91 additions and 56 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue