Skip to content

Commit 237f5e1

Browse files
committed
Change Ktor log level to INFO and add 'HttpClient' tag to KermitHttpLogger
1 parent 4f57e65 commit 237f5e1

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

androidApp/src/main/kotlin/org/meshtastic/app/di/NetworkModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class NetworkModule {
111111
if (buildConfigProvider.isDebug) {
112112
install(plugin = Logging) {
113113
logger = KermitHttpLogger
114-
level = LogLevel.BODY
114+
level = LogLevel.INFO
115115
}
116116
}
117117
}

core/network/src/commonMain/kotlin/org/meshtastic/core/network/KermitHttpLogger.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ import co.touchlab.kermit.Logger
2020
import io.ktor.client.plugins.logging.Logger as KtorLogger
2121

2222
/**
23-
* Bridges Ktor's HTTP client logging to [Kermit][Logger] so HTTP request/response events appear in the standard app
24-
* logs rather than going to [System.out] via Ktor's default [io.ktor.client.plugins.logging.Logger.DEFAULT].
23+
* Bridges Ktor's HTTP client logging to [Kermit][Logger].
2524
*
2625
* Usage:
2726
* ```
@@ -34,7 +33,5 @@ import io.ktor.client.plugins.logging.Logger as KtorLogger
3433
* ```
3534
*/
3635
object KermitHttpLogger : KtorLogger {
37-
override fun log(message: String) {
38-
Logger.d { message }
39-
}
36+
override fun log(message: String) = Logger.withTag("HttpClient").d { message }
4037
}

desktopApp/src/main/kotlin/org/meshtastic/desktop/di/DesktopKoinModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ private fun desktopPlatformStubsModule() = module {
229229
if (DesktopBuildConfig.IS_DEBUG) {
230230
install(Logging) {
231231
logger = KermitHttpLogger
232-
level = LogLevel.BODY
232+
level = LogLevel.INFO
233233
}
234234
}
235235
}

0 commit comments

Comments
 (0)