fastapi-utils
fastapi-utils copied to clipboard
Timing middleware: add support for alternate message formatters
Hi, and thanks for the great library of utils! I needed support for structured log messages to avoid writing custom parser logic in my app's log aggregation service (Datadog). If you are interested in including such support, this PR is how I implemented that. Backwards-compatible changes:
- Add support for an optional
message_formatterargument toadd_timing_middleware() - Test coverage for new feature
- Documentation for new feature
- Fix
CONTRIBUTING.mdto referencemake docs-live
This is exactly what I need, I hope it gets merged soon :) @dmontagu