feat(logging): Replace Timber with Kermit for multiplatform logging (#4083)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2025-12-28 08:30:15 -06:00 committed by GitHub
parent a927481e4d
commit 0776e029f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
92 changed files with 727 additions and 957 deletions

View file

@ -19,7 +19,7 @@ package com.geeksville.mesh.util
import android.os.RemoteException
import android.util.Log
import timber.log.Timber
import co.touchlab.kermit.Logger
object Exceptions {
// / Set in Application.onCreate
@ -31,10 +31,9 @@ object Exceptions {
* After reporting return
*/
fun report(exception: Throwable, tag: String? = null, message: String? = null) {
Timber.e(
exception,
"Exceptions.report: $tag $message",
) // print the message to the log _before_ telling the crash reporter
Logger.e(exception) {
"Exceptions.report: $tag $message"
} // print the message to the log _before_ telling the crash reporter
reporter?.let { r -> r(exception, tag, message) }
}
}
@ -58,7 +57,7 @@ fun ignoreException(silent: Boolean = false, inner: () -> Unit) {
inner()
} catch (ex: Throwable) {
// DO NOT THROW users expect we have fully handled/discarded the exception
if (!silent) Timber.e("ignoring exception", ex)
if (!silent) Logger.e(ex) { "ignoring exception" }
}
}