-
Notifications
You must be signed in to change notification settings - Fork 801
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
Add debug flag&handler for request #1050
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: alex-ak1 <[email protected]>
Signed-off-by: alex-ak1 <[email protected]> Signed-off-by: alex-ak1 <[email protected]>
Signed-off-by: alex-ak1 <[email protected]>
Signed-off-by: alex-ak1 <[email protected]>
Signed-off-by: alex-ak1 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it has now been a couple people who have asked for this I am ok with the feature. Just a couple comments, some docstring would be nice as well so someone knows what it does.
@@ -140,6 +140,13 @@ def log_message(self, format, *args): | |||
"""Log nothing.""" | |||
|
|||
|
|||
class _PrintHandler(WSGIRequestHandler): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could just use WSGIRequestHandler instead of creating a new handler. It will log by default.
@@ -210,6 +217,7 @@ def start_wsgi_server( | |||
client_capath: Optional[str] = None, | |||
protocol: int = ssl.PROTOCOL_TLS_SERVER, | |||
client_auth_required: bool = False, | |||
debug: bool = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than just a debug flag, I wonder if we should let users specify the handler_class they are interested in using. That would be more flexible than having flags for everything.
Add parameter
debug: bool
forstart_wsgi_server
andstart_http_server
.If debug=True wsgi server prints every request to console.
Related to #925