(message: string, fields?: Record<string, unknown>)
| 12 | } |
| 13 | |
| 14 | export function logImpactReferralDebug(message: string, fields?: Record<string, unknown>): void { |
| 15 | if (!isImpactDebugLoggingEnabled()) return; |
| 16 | |
| 17 | console.log('[impact-referral-debug]', message, { |
| 18 | at: new Date().toISOString(), |
| 19 | ...(fields ?? {}), |
| 20 | }); |
| 21 | } |
| 22 | |
| 23 | /** Truncate a response body for safe logging. Impact responses can be large. */ |
| 24 | export function truncateForLog(body: string | null | undefined, max = 500): string | null { |
no test coverage detected