Skip to content

Commit

Permalink
feat(debug): log request id when debug mode is on (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
go1t authored Mar 24, 2023
1 parent ebecd83 commit 201b2fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ export class Client {
compress,
})

if (this.debug?.verbose && response.headers.get('x-request-id')) {
console.info('Request ID: ', response.headers.get('x-request-id'))
}

const contentType = response.headers.get('content-type')

if (contentType && contentType.includes('json')) {
Expand Down

0 comments on commit 201b2fa

Please sign in to comment.