mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-05-24 23:01:22 -04:00
Change Ktor log level to INFO and add 'HttpClient' tag to KermitHttpLogger
This commit is contained in:
2
.github/copilot-instructions.md
vendored
2
.github/copilot-instructions.md
vendored
@@ -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` |
|
||||
|
||||
2
.github/workflows/publish-core.yml
vendored
2
.github/workflows/publish-core.yml
vendored
@@ -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 }}
|
||||
|
||||
2
.github/workflows/reusable-check.yml
vendored
2
.github/workflows/reusable-check.yml
vendored
@@ -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
|
||||
|
||||
@@ -111,7 +111,7 @@ class NetworkModule {
|
||||
if (buildConfigProvider.isDebug) {
|
||||
install(plugin = Logging) {
|
||||
logger = KermitHttpLogger
|
||||
level = LogLevel.BODY
|
||||
level = LogLevel.INFO
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 }
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ private fun desktopPlatformStubsModule() = module {
|
||||
if (DesktopBuildConfig.IS_DEBUG) {
|
||||
install(Logging) {
|
||||
logger = KermitHttpLogger
|
||||
level = LogLevel.BODY
|
||||
level = LogLevel.INFO
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user