fix: route networkmock logging through Kermit - #123
Open
MaxMichel2 wants to merge 1 commit into
Open
MaxMichel2 wants to merge 1 commit into
MaxMichel2 wants to merge 1 commit into
Conversation
Replaces ~35 unconditional println calls in MockConfigRepository and NetworkMockPlugin with gated Kermit logging (tag DevViewNetworkMock, shared with devview-networkmock's UI logging). The plugin's multi-line per-request trace (including 7 decorative '====' separators) collapses into one line per intercepted request, e.g.: GET /v1/users/42 -> MOCK 200/default GET /v1/users/42 -> NETWORK (no operation match) No response body content is ever logged. Detekt's ForbiddenMethodCall rule (println/print) is now enforced repo-wide - confirmed via a clean detektFull run with no other println call sites in main source. A host app can silence or adjust verbosity via Logger.setMinSeverity(...); devview-consolelogger, if installed, captures these logs automatically. Closes #86. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #86.
devview-networkmock-coreanddevview-networkmock-ktoremitted ~35 unconditionalprintlncalls covering config loading, request matching, and response serving, with no way to turn them off. This routes all of them through Kermit — already a dependency of every DevView library module via the multiplatform convention plugin, and already used bydevview-networkmock's own UI (LocalMockColorScheme.kt) — so this adds no new dependency and no new abstraction.What changed
MockConfigRepository: spec-load success logs atdebug, load failures atwarnwith the throwable attached, request-matching outcomes atverbose.NetworkMockPlugin: the previous per-request trace (up to ~15 lines including 7 decorative====separators) collapses into one line per intercepted request, e.g.:DevViewNetworkMock— the same tagdevview-networkmock's UI already uses — so a host can filter every NetworkMock log line by tag regardless of which module emitted it, anddevview-consolelogger, if installed, captures them automatically via its KermitLogWriter.ForbiddenMethodCallrule (flaggingkotlin.io.println/print) is flipped fromactive: falsetoactive: truerepo-wide. Verified clean — these two files were the only main-sourceprintlncall sites in the repo.Logger.setMinSeverity(...), documented in the module docs.Not in scope
No public API change — no
apiDumpneeded.Verification
All green.
🤖 Generated with Claude Code