Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

alex-ak1
Copy link

Add parameter debug: bool for start_wsgi_server and start_http_server.

If debug=True wsgi server prints every request to console.

Related to #925

Copy link
Member

@csmarchbanks csmarchbanks left a 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):
Copy link
Member

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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants