Summary
devview-networkmock-core and devview-networkmock-ktor emit roughly 65 unconditional println calls covering every step of config loading, request matching, and response serving. These ship straight into any host app's logcat, unconditionally, with no way to turn them off — and several of them log full request URLs and response bodies. This is independent of the OpenAPI migration (tracked in the epic, #72) and can be picked up any time.
Current state
Two hot spots:
MockConfigRepository — devview-networkmock-core/src/commonMain/kotlin/com/worldline/devview/networkmock/core/repository/MockConfigRepository.kt, roughly 25 println calls across loadConfiguration() (:206-252) and findMatchingMock() (:292-377), including per-group and per-environment iteration logging and full path/method/query comparison traces on every single intercepted request.
NetworkMockPlugin — devview-networkmock-ktor/src/commonMain/kotlin/com/worldline/devview/networkmock/ktor/plugin/NetworkMockPlugin.kt, roughly 40 println calls (LOG_PREFIX constant at :37) covering plugin install, every intercepted request's host/path/method (:170), full mock-vs-network decision tracing, and — notably — the response file name and status code on every successful mock (:248-249).
MockStateRepository also logs on every state write (setGlobalMockingEnabled :240,245, setEndpointMockState :271-273, setAllEndpointStates :334-336, all in devview-networkmock-core/src/commonMain/kotlin/com/worldline/devview/networkmock/core/repository/MockStateRepository.kt).
None of this is gated behind a log level, a debug flag, or a way to disable it. A host app integrating this library gets this in its logcat/console on every request, all the time, with no opt-out — and depending on mock content, response bodies could contain data a team doesn't want silently duplicated into device logs.
What to build
Introduce a minimal logging abstraction (or reuse one if this repo already has a shared logging convention elsewhere in DevView — check before adding a new one) with at least an on/off gate, defaulting to a sensible state for a developer tool (arguably on-by-default is fine for a dev-only overlay tool, but it must be possible to turn off, and it should not be the current firehose of ~40+ lines per single request).
Suggested minimal shape: a single NetworkMockLogger (or similar) with a enabled: Boolean toggle, injected the same way NetworkMockResourceLoader already is, replacing every println call site. Consider consolidating the current multi-line-per-request tracing into a single structured log line per request (e.g. one line: method path -> MOCK|NETWORK (reason)), which both reduces log volume and reduces sensitive-data exposure (drop full response bodies from logs entirely — the status code and file/example name is enough context).
Acceptance criteria
Files likely touched
devview-networkmock-core/src/commonMain/kotlin/com/worldline/devview/networkmock/core/repository/MockConfigRepository.kt
devview-networkmock-core/src/commonMain/kotlin/com/worldline/devview/networkmock/core/repository/MockStateRepository.kt
devview-networkmock-ktor/src/commonMain/kotlin/com/worldline/devview/networkmock/ktor/plugin/NetworkMockPlugin.kt
- New shared logging utility, likely in
devview-networkmock-core
Summary
devview-networkmock-coreanddevview-networkmock-ktoremit roughly 65 unconditionalprintlncalls covering every step of config loading, request matching, and response serving. These ship straight into any host app's logcat, unconditionally, with no way to turn them off — and several of them log full request URLs and response bodies. This is independent of the OpenAPI migration (tracked in the epic, #72) and can be picked up any time.Current state
Two hot spots:
MockConfigRepository—devview-networkmock-core/src/commonMain/kotlin/com/worldline/devview/networkmock/core/repository/MockConfigRepository.kt, roughly 25printlncalls acrossloadConfiguration()(:206-252) andfindMatchingMock()(:292-377), including per-group and per-environment iteration logging and full path/method/query comparison traces on every single intercepted request.NetworkMockPlugin—devview-networkmock-ktor/src/commonMain/kotlin/com/worldline/devview/networkmock/ktor/plugin/NetworkMockPlugin.kt, roughly 40printlncalls (LOG_PREFIXconstant at:37) covering plugin install, every intercepted request's host/path/method (:170), full mock-vs-network decision tracing, and — notably — the response file name and status code on every successful mock (:248-249).MockStateRepositoryalso logs on every state write (setGlobalMockingEnabled:240,245,setEndpointMockState:271-273,setAllEndpointStates:334-336, all indevview-networkmock-core/src/commonMain/kotlin/com/worldline/devview/networkmock/core/repository/MockStateRepository.kt).None of this is gated behind a log level, a debug flag, or a way to disable it. A host app integrating this library gets this in its logcat/console on every request, all the time, with no opt-out — and depending on mock content, response bodies could contain data a team doesn't want silently duplicated into device logs.
What to build
Introduce a minimal logging abstraction (or reuse one if this repo already has a shared logging convention elsewhere in DevView — check before adding a new one) with at least an on/off gate, defaulting to a sensible state for a developer tool (arguably on-by-default is fine for a dev-only overlay tool, but it must be possible to turn off, and it should not be the current firehose of ~40+ lines per single request).
Suggested minimal shape: a single
NetworkMockLogger(or similar) with aenabled: Booleantoggle, injected the same wayNetworkMockResourceLoaderalready is, replacing everyprintlncall site. Consider consolidating the current multi-line-per-request tracing into a single structured log line per request (e.g. one line:method path -> MOCK|NETWORK (reason)), which both reduces log volume and reduces sensitive-data exposure (drop full response bodies from logs entirely — the status code and file/example name is enough context).Acceptance criteria
printlncalls acrossdevview-networkmock-coreanddevview-networkmock-ktorare replaced with a gated logging call.printlnoutput (if any — checkMockConfigRepositoryTest.kt,NetworkMockPluginTest.kt) are updated accordingly.Files likely touched
devview-networkmock-core/src/commonMain/kotlin/com/worldline/devview/networkmock/core/repository/MockConfigRepository.ktdevview-networkmock-core/src/commonMain/kotlin/com/worldline/devview/networkmock/core/repository/MockStateRepository.ktdevview-networkmock-ktor/src/commonMain/kotlin/com/worldline/devview/networkmock/ktor/plugin/NetworkMockPlugin.ktdevview-networkmock-core