From 059ee976c99d717ac15801f84350d44c742ce9d8 Mon Sep 17 00:00:00 2001 From: James Rich Date: Sat, 23 May 2026 16:09:52 -0500 Subject: [PATCH] Change Ktor log level to INFO and add 'HttpClient' tag to KermitHttpLogger --- .github/copilot-instructions.md | 2 +- .github/workflows/publish-core.yml | 2 +- .github/workflows/reusable-check.yml | 2 +- .../src/main/kotlin/org/meshtastic/app/di/NetworkModule.kt | 2 +- .../kotlin/org/meshtastic/core/network/KermitHttpLogger.kt | 7 ++----- .../kotlin/org/meshtastic/desktop/di/DesktopKoinModule.kt | 2 +- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index f6f0e772ac..a0664c4baa 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -33,7 +33,7 @@ git submodule update --init KMP modules have different task names than pure-Android modules. Using the wrong name silently skips tests or fails resolution. -| Intent | KMP modules (`core:*`, `feature:*`) | Android-only (`app`, `core:api`, `core:barcode`) | +| Intent | KMP modules (`core:*`, `feature:*`) | Android-only (`app`, `core:barcode`) | |--------|--------------------------------------|--------------------------------------------------| | Run tests | `:module:allTests` | `:module:testFdroidDebugUnitTest` | | Detekt | `:module:detekt` (lifecycle task) | `:module:detekt` | diff --git a/.github/workflows/publish-core.yml b/.github/workflows/publish-core.yml index 6bbf344f0e..f7fb7c4016 100644 --- a/.github/workflows/publish-core.yml +++ b/.github/workflows/publish-core.yml @@ -45,7 +45,7 @@ jobs: fi - name: Publish to GitHub Packages - run: ./gradlew :core:api:publish :core:model:publish :core:proto:publish + run: ./gradlew :core:model:publish :core:proto:publish env: GITHUB_ACTOR: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/reusable-check.yml b/.github/workflows/reusable-check.yml index d656fa9906..d958fbe2b6 100644 --- a/.github/workflows/reusable-check.yml +++ b/.github/workflows/reusable-check.yml @@ -112,7 +112,7 @@ jobs: - name: Lint, Analysis & KMP Smoke Compile if: inputs.run_lint == true - run: ./gradlew spotlessCheck detekt androidApp:lintFdroidDebug androidApp:lintGoogleDebug core:barcode:lintFdroidDebug core:barcode:lintGoogleDebug core:api:lintDebug kmpSmokeCompile -Pci=true --continue + run: ./gradlew spotlessCheck detekt androidApp:lintFdroidDebug androidApp:lintGoogleDebug core:barcode:lintFdroidDebug core:barcode:lintGoogleDebug kmpSmokeCompile -Pci=true --continue - name: KMP Smoke Compile (lint skipped) if: inputs.run_lint == false diff --git a/androidApp/src/main/kotlin/org/meshtastic/app/di/NetworkModule.kt b/androidApp/src/main/kotlin/org/meshtastic/app/di/NetworkModule.kt index ab895e435f..f4d90ec13b 100644 --- a/androidApp/src/main/kotlin/org/meshtastic/app/di/NetworkModule.kt +++ b/androidApp/src/main/kotlin/org/meshtastic/app/di/NetworkModule.kt @@ -111,7 +111,7 @@ class NetworkModule { if (buildConfigProvider.isDebug) { install(plugin = Logging) { logger = KermitHttpLogger - level = LogLevel.BODY + level = LogLevel.INFO } } } diff --git a/core/network/src/commonMain/kotlin/org/meshtastic/core/network/KermitHttpLogger.kt b/core/network/src/commonMain/kotlin/org/meshtastic/core/network/KermitHttpLogger.kt index cabeb977a4..71a8d8b630 100644 --- a/core/network/src/commonMain/kotlin/org/meshtastic/core/network/KermitHttpLogger.kt +++ b/core/network/src/commonMain/kotlin/org/meshtastic/core/network/KermitHttpLogger.kt @@ -20,8 +20,7 @@ import co.touchlab.kermit.Logger import io.ktor.client.plugins.logging.Logger as KtorLogger /** - * Bridges Ktor's HTTP client logging to [Kermit][Logger] so HTTP request/response events appear in the standard app - * logs rather than going to [System.out] via Ktor's default [io.ktor.client.plugins.logging.Logger.DEFAULT]. + * Bridges Ktor's HTTP client logging to [Kermit][Logger]. * * Usage: * ``` @@ -34,7 +33,5 @@ import io.ktor.client.plugins.logging.Logger as KtorLogger * ``` */ object KermitHttpLogger : KtorLogger { - override fun log(message: String) { - Logger.d { message } - } + override fun log(message: String) = Logger.withTag("HttpClient").d { message } } diff --git a/desktopApp/src/main/kotlin/org/meshtastic/desktop/di/DesktopKoinModule.kt b/desktopApp/src/main/kotlin/org/meshtastic/desktop/di/DesktopKoinModule.kt index e8631ad834..1ddeb1cf12 100644 --- a/desktopApp/src/main/kotlin/org/meshtastic/desktop/di/DesktopKoinModule.kt +++ b/desktopApp/src/main/kotlin/org/meshtastic/desktop/di/DesktopKoinModule.kt @@ -229,7 +229,7 @@ private fun desktopPlatformStubsModule() = module { if (DesktopBuildConfig.IS_DEBUG) { install(Logging) { logger = KermitHttpLogger - level = LogLevel.BODY + level = LogLevel.INFO } } }