Skip to content

Format runserver access logs before logging#584

Open
lin-hongkuan wants to merge 2 commits into
django:mainfrom
lin-hongkuan:codex/fix-runserver-log-action-formatting
Open

Format runserver access logs before logging#584
lin-hongkuan wants to merge 2 commits into
django:mainfrom
lin-hongkuan:codex/fix-runserver-log-action-formatting

Conversation

@lin-hongkuan

Copy link
Copy Markdown

Summary

  • format runserver access-log messages with their details before passing them to the logger
  • apply the same pattern to HTTP and WebSocket runserver log messages
  • add a regression test that verifies the logger receives a single formatted message instead of a message plus details as a second positional argument

Fixes #576

Tests

  • python -m pytest tests\test_runserver.py tests\test_cli.py -q
  • python -m pytest -q tests --ignore=tests/test_packaging.py
  • python -m black --check daphne\management\commands\runserver.py tests\test_runserver.py
  • python -m flake8 daphne\management\commands\runserver.py tests\test_runserver.py
  • git diff --check

Note: as in #583, python -m pytest -q fails in my local editable-install environment only at tests/test_packaging.py::test_fd_endpoint_plugin_installed, because the Twisted plugin file is not present under the selected site-packages path. The runtime tests pass with that packaging-only test excluded.

@lin-hongkuan lin-hongkuan force-pushed the codex/fix-runserver-log-action-formatting branch from cbd29ea to 3e439da Compare June 24, 2026 17:38
@lin-hongkuan lin-hongkuan force-pushed the codex/fix-runserver-log-action-formatting branch from 76508a1 to 67f5c0c Compare June 25, 2026 03:21
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.

Error logging.info() using runserver

1 participant