Skip to content

[doc] guide for python SDK to get process about how SDK call REST api #19716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions doc/dev/debug_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Debug

This guide is to help Python SDK users to get the process about how SDK call REST api

(1) Copy the following code in your .py file
```
import sys
import logging

logger = logging.getLogger('')
logger.setLevel(logging.DEBUG)
handler = logging.StreamHandler(stream=sys.stdout, )
logger.addHandler(handler)
formatter = logging.Formatter(
'%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)
```

![Position example](./debug_guide_position.png "Position example")

(2) Run your .py program and you could find the log info in screen. It is convenient to get the process about how SDK call REST api:

![example](./debug_guide_example.png "example")
Binary file added doc/dev/debug_guide_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/dev/debug_guide_position.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.