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

@ -55,7 +55,7 @@ dependencies {
implementation(libs.androidx.annotation)
implementation(libs.kotlinx.serialization.json)
implementation(libs.timber)
implementation(libs.kermit)
implementation(libs.zxing.android.embedded) { isTransitive = false }
implementation(libs.zxing.core)

View file

@ -2,30 +2,6 @@
<SmellBaseline>
<ManuallySuppressedIssues/>
<CurrentIssues>
<ID>MagicNumber:Channel.kt$0xff</ID>
<ID>MagicNumber:ChannelOption.kt$.03125f</ID>
<ID>MagicNumber:ChannelOption.kt$.0625f</ID>
<ID>MagicNumber:ChannelOption.kt$.203125f</ID>
<ID>MagicNumber:ChannelOption.kt$.40625f</ID>
<ID>MagicNumber:ChannelOption.kt$.8125f</ID>
<ID>MagicNumber:ChannelOption.kt$1.6250f</ID>
<ID>MagicNumber:ChannelOption.kt$1000f</ID>
<ID>MagicNumber:ChannelOption.kt$1600</ID>
<ID>MagicNumber:ChannelOption.kt$200</ID>
<ID>MagicNumber:ChannelOption.kt$3.25f</ID>
<ID>MagicNumber:ChannelOption.kt$31</ID>
<ID>MagicNumber:ChannelOption.kt$400</ID>
<ID>MagicNumber:ChannelOption.kt$5</ID>
<ID>MagicNumber:ChannelOption.kt$62</ID>
<ID>MagicNumber:ChannelOption.kt$800</ID>
<ID>MagicNumber:ChannelOption.kt$ChannelOption.LONG_FAST$.250f</ID>
<ID>MagicNumber:ChannelOption.kt$ChannelOption.LONG_MODERATE$.125f</ID>
<ID>MagicNumber:ChannelOption.kt$ChannelOption.LONG_SLOW$.125f</ID>
<ID>MagicNumber:ChannelOption.kt$ChannelOption.MEDIUM_FAST$.250f</ID>
<ID>MagicNumber:ChannelOption.kt$ChannelOption.MEDIUM_SLOW$.250f</ID>
<ID>MagicNumber:ChannelOption.kt$ChannelOption.SHORT_FAST$.250f</ID>
<ID>MagicNumber:ChannelOption.kt$ChannelOption.SHORT_SLOW$.250f</ID>
<ID>MagicNumber:ChannelOption.kt$ChannelOption.VERY_LONG_SLOW$.0625f</ID>
<ID>MagicNumber:ChannelSet.kt$40</ID>
<ID>MagicNumber:ChannelSet.kt$960</ID>
<ID>SwallowedException:ChannelSet.kt$ex: Throwable</ID>

View file

@ -17,7 +17,7 @@
package org.meshtastic.core.model
import timber.log.Timber
import co.touchlab.kermit.Logger
/** Provide structured access to parse and compare device version strings */
data class DeviceVersion(val asString: String) : Comparable<DeviceVersion> {
@ -28,7 +28,7 @@ data class DeviceVersion(val asString: String) : Comparable<DeviceVersion> {
try {
verStringToInt(asString)
} catch (e: Exception) {
Timber.w("Exception while parsing version '$asString', assuming version 0")
Logger.w { "Exception while parsing version '$asString', assuming version 0" }
0
}

View file

@ -20,14 +20,13 @@ package org.meshtastic.core.model.util
import android.graphics.Bitmap
import android.net.Uri
import android.util.Base64
import co.touchlab.kermit.Logger
import com.google.zxing.BarcodeFormat
import com.google.zxing.MultiFormatWriter
import com.journeyapps.barcodescanner.BarcodeEncoder
import org.meshtastic.core.model.Channel
import org.meshtastic.proto.AppOnlyProtos.ChannelSet
import timber.log.Timber
import java.net.MalformedURLException
import kotlin.jvm.Throws
private const val MESHTASTIC_HOST = "meshtastic.org"
private const val CHANNEL_PATH = "/e/"
@ -86,6 +85,6 @@ fun ChannelSet.qrCode(shouldAdd: Boolean): Bitmap? = try {
val barcodeEncoder = BarcodeEncoder()
barcodeEncoder.createBitmap(bitMatrix)
} catch (ex: Throwable) {
Timber.e("URL was too complex to render as barcode")
Logger.e { "URL was too complex to render as barcode" }
null
}