feat(debug): log body, headers and params for sdk api calls - #502
Merged
Conversation
joerivanveen
approved these changes
Jul 9, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds richer debug logging around SDK API traffic by including request/response details (body, headers, and query params) in the existing transport-layer logging middleware.
Changes:
- Log outgoing request body (JSON-decoded), headers, and query parameters in
Sending API requestdebug logs. - Log response headers in
Received API responsedebug logs (in addition to status and decoded body).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
NabDevs
approved these changes
Jul 9, 2026
myparcel-bot
Bot
force-pushed
the
fix/log-headers-body-and-params-for-sdkapi
branch
from
July 9, 2026 14:18
f3b6b4f to
b14ffeb
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #502 +/- ##
=========================================
Coverage 94.25% 94.26%
- Complexity 2350 2354 +4
=========================================
Files 350 350
Lines 7538 7547 +9
=========================================
+ Hits 7105 7114 +9
Misses 433 433 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Casting the request body to a string for logging advanced the stream pointer to EOF. For request bodies larger than the curl handler's in-memory threshold this could send an empty or partial body downstream. Rewind after logging, mirroring the response path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…field Add assertions for the request body, request headers and response headers logging (including scrubbing/masking). Remove the params field: Guzzle folds the query option into the URI and unsets it from options before the handler stack runs, so it was always empty — the query string is already logged (scrubbed) as part of the uri field. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
scrubArray only masked scalar leaves whose own key was sensitive, so a sensitive key holding an array leaked its values (e.g. ['token' => ['secret']] stayed unmasked). Carry a forceMask flag down the recursion: once a key matches, every value beneath it is masked regardless of child key names, while structure is preserved. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
FreekVR
force-pushed
the
fix/log-headers-body-and-params-for-sdkapi
branch
from
July 9, 2026 16:00
c59d12d to
805f07c
Compare
FreekVR
enabled auto-merge
July 9, 2026 16:00
myparcel-bot Bot
added a commit
that referenced
this pull request
Jul 9, 2026
## [4.3.0](v4.2.1...v4.3.0) (2026-07-09) ### ✨ New Features * **debug:** log body, headers and params for sdk api calls ([#502](#502)) ([3b5a1db](3b5a1db))
Contributor
|
🎉 This PR is included in version 4.3.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
adds additional debug information to the myparcel debug logs for any API calls made through the sdk