makenotion / notion-sdk-js

Official Notion JavaScript Client
https://developers.notion.com/docs
MIT License
4.96k stars 592 forks source link

feat: Log the response body when the request succeeds with LogLevel.DEBUG #479

Closed whatasame closed 10 months ago

whatasame commented 11 months ago

Issue

The README mentions that the response body will be logged on the DEBUG level, but the actual code currently supports logging only in error response cases. See following excerpt from the README.md

If you're debugging an application, and would like the client to log response bodies, set the logLevel option to LogLevel.DEBUG.

Implementation

Added a log method for success response cases.

[!NOTE]

This produces a non-pretty JSON string to prevent unintended creation of strings on non-DEBUG levels.

Example

image

CLAassistant commented 11 months ago

CLA assistant check
All committers have signed the CLA.

cwang314 commented 10 months ago

Hey, thanks for opening this PR. We're doing some git history cleanup and need to close the PR as it'll become invalid. Afterwards, please reclone the repo and you can reopen the PR. Thanks for your patience and sincere apologies for the trouble.