-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Refactor httplib: Remove debug code to a filter #4440
Comments
@flycash If you do not hurry, I want to complete this task. Because I am not familiar with the source code of beego project, so I need a few days to get familiar with it. If all goes ok, I will submit a pr next week. Do you think this is ok? |
@flycash https://github.com/beego/beego/blob/develop/client/httplib/httplib.go#L184 |
I found that there is no place to call |
Thank you @anoymouscoder . This is not an urgent issue, and I assigned it to you.
I think we could remove both The scenario is that users want to log request and response when they use httplib. In the future, they could use this |
@flycash Thank you for your detailed instrutions, I will start now! |
Refactor httplib: Move debug code to a filter #4440
This issue is inactive for a long time. |
The httplib.BeegoHTTPSettings has field
ShowDebug bool
It only be used in method
doRequest
:But I don't see any code use
b.dump
. So I think we could removeb.dump
and this part.And then we provide a filter named
LogFilter
. It's default filter and its reponsibility is to log request and response. And if the request.ShowDebug = true, it logs request and response:The text was updated successfully, but these errors were encountered: