Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

fix: gate networkmock logging

Open
#86 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
kotlin
Domain
devtools

Research direction

Start by checking for an existing shared logging convention, then inspect the println call sites in MockConfigRepository.kt, MockStateRepository.kt, and NetworkMockPlugin.kt. Review MockConfigRepositoryTest.kt and NetworkMockPluginTest.kt for output assertions; done means all listed logging is gated, host apps can disable it, and response bodies are never logged.

Written by the indexing model from the issue text.

Description

bug

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

  • All ~65 println calls across devview-networkmock-core and devview-networkmock-ktor are replaced with a gated logging call.
  • Logging can be disabled entirely by a host app.
  • No response body content is ever logged (status code + example identifier is sufficient).
  • Existing tests that assert on println output (if any — check MockConfigRepositoryTest.kt, NetworkMockPluginTest.kt) are updated accordingly.

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
Dominant language
Kotlin
Stars
10
Forks
2
Avg merge
2d 14h
Merged PRs (30d)
13

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from worldline/devview

All issues in worldline/devview

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.