Skip to content

Commit 222df26

Browse files
committed
Release v0.2.0
### Added - **Advanced logging customizations** in `register_exception_handlers`: - `log_level`: override verbosity for exception logging. - `log_request_context`: toggle to include/exclude request headers in logs. - `log_header_keys`: define which headers are logged (default: `x-request-id`, `user-agent`, etc.). - `extra_log_fields`: inject custom structured metadata into logs (e.g. `user_id`, masked API keys). - **Response headers echo** in `register_exception_handlers`: - `response_headers=True` → default headers echoed back. - `response_headers=False` → no headers echoed. - `response_headers=("x-user-id",)` → custom headers echoed. - `APIException` now accepts header parameters (headers can carry custom values into responses). - **Mypy** support added for static type checking. - Improved documentation for `register_exception_handlers` with usage patterns, logging, and examples. ### Changed - Logging format has been revamped → now more structured, readable, and consistent. - Error logging now includes richer metadata: request path, method, client IP, HTTP version, etc. ### Fixed - Swagger/OpenAPI sometimes showed inconsistent error schemas when `data` was missing. - **File structure cleanup**: imports in `__init__.py` were fixed and simplified. The package is now easier to import and fully modular. - Fixed a type issue where `error_code` was not properly annotated as `BaseExceptionCode`.
1 parent 9898f0f commit 222df26

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

requirements.txt

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
1-
annotated-types==0.7.0 ; python_version >= "3.10"
2-
anyio==4.10.0 ; python_version >= "3.10"
3-
certifi==2025.8.3 ; python_version >= "3.10"
4-
click==8.2.1 ; python_version >= "3.10"
5-
colorama==0.4.6 ; python_version >= "3.10" and platform_system == "Windows"
6-
exceptiongroup==1.3.0 ; python_version < "3.11" and python_version >= "3.10"
7-
fastapi==0.116.1 ; python_version >= "3.10"
8-
h11==0.16.0 ; python_version >= "3.10"
9-
httpcore==1.0.9 ; python_version >= "3.10"
10-
httpx==0.28.1 ; python_version >= "3.10"
11-
idna==3.10 ; python_version >= "3.10"
12-
pydantic-core==2.33.2 ; python_version >= "3.10"
13-
pydantic==2.11.7 ; python_version >= "3.10"
14-
sniffio==1.3.1 ; python_version >= "3.10"
15-
starlette==0.47.2 ; python_version >= "3.10"
16-
typing-extensions==4.14.1 ; python_version >= "3.10"
17-
typing-inspection==0.4.1 ; python_version >= "3.10"
1+
fastapi>=0.115.4
2+
httpx>=0.27.0
3+
pydantic>=2.0.0
4+
click>=8.0.0

0 commit comments

Comments
 (0)