Skip to content

Commit 059ee97

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

6 files changed

Lines changed: 7 additions & 10 deletions

File tree

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ git submodule update --init
3333

3434
KMP modules have different task names than pure-Android modules. Using the wrong name silently skips tests or fails resolution.
3535

36-
| Intent | KMP modules (`core:*`, `feature:*`) | Android-only (`app`, `core:api`, `core:barcode`) |
36+
| Intent | KMP modules (`core:*`, `feature:*`) | Android-only (`app`, `core:barcode`) |
3737
|--------|--------------------------------------|--------------------------------------------------|
3838
| Run tests | `:module:allTests` | `:module:testFdroidDebugUnitTest` |
3939
| Detekt | `:module:detekt` (lifecycle task) | `:module:detekt` |

.github/workflows/publish-core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
fi
4646
4747
- name: Publish to GitHub Packages
48-
run: ./gradlew :core:api:publish :core:model:publish :core:proto:publish
48+
run: ./gradlew :core:model:publish :core:proto:publish
4949
env:
5050
GITHUB_ACTOR: ${{ github.actor }}
5151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/reusable-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112

113113
- name: Lint, Analysis & KMP Smoke Compile
114114
if: inputs.run_lint == true
115-
run: ./gradlew spotlessCheck detekt androidApp:lintFdroidDebug androidApp:lintGoogleDebug core:barcode:lintFdroidDebug core:barcode:lintGoogleDebug core:api:lintDebug kmpSmokeCompile -Pci=true --continue
115+
run: ./gradlew spotlessCheck detekt androidApp:lintFdroidDebug androidApp:lintGoogleDebug core:barcode:lintFdroidDebug core:barcode:lintGoogleDebug kmpSmokeCompile -Pci=true --continue
116116

117117
- name: KMP Smoke Compile (lint skipped)
118118
if: inputs.run_lint == false

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)