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