@@ -141,20 +141,12 @@ function buildApiDebugDetails(
141141}
142142
143143/**
144- * Debug an API response with detailed request information.
144+ * Debug an API response. Only failed requests (error or status >= 400)
145+ * produce structured output; successful responses optionally log a
146+ * one-liner at the `notice` debug namespace.
145147 *
146- * For failed requests (status >= 400 or error), logs a structured
147- * object with:
148- * - endpoint (human-readable description)
149- * - requestedAt (ISO timestamp, if passed)
150- * - method, url, durationMs
151- * - sanitized request headers (Authorization redacted)
152- * - cfRay (extracted from response headers if present)
153- * - sanitized response headers
154- * - responseBody (truncated)
155- *
156- * All request-headers are sanitized to redact Authorization and
157- * `*api-key*` values.
148+ * Request and response headers are sanitized via `sanitizeHeaders` so
149+ * Authorization and `*api-key*` values are redacted.
158150 */
159151export function debugApiResponse (
160152 endpoint : string ,
@@ -173,7 +165,6 @@ export function debugApiResponse(
173165 ) ,
174166 )
175167 } else if ( status && status >= 400 ) {
176- // For failed requests, log detailed information.
177168 if ( requestInfo ) {
178169 debugDir ( buildApiDebugDetails ( { endpoint, status } , requestInfo ) )
179170 } else {
0 commit comments