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

capture web request logs #1211

Merged
merged 1 commit into from
Apr 24, 2023
Merged

capture web request logs #1211

merged 1 commit into from
Apr 24, 2023

Conversation

davidism
Copy link
Contributor

@davidism davidism commented Apr 24, 2023

Override RequestHandler.log_message to write to the command's logger instead of directly to stderr. The logger is passed when creating the server, and the handler can access it through its reference to the server.

The fix for python/cpython#100001 (remove ANSI escapes from URLs) is included as well, since it was added in security releases and isn't guaranteed to be available in an arbitrary Python installation until 3.12.

fixes #1090

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome - thanks!

@freakboy3742 freakboy3742 merged commit 906d5fd into beeware:main Apr 24, 2023
@davidism davidism deleted the log-web-requests branch April 24, 2023 17:12
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.

Web / Output from HTTPServer is not Captured in Briefcase Log
2 participants