Skip to content

Commit 5c21891

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 d007e47 commit 5c21891

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,22 @@ Reading the [full documentation](https://akutayural.github.io/APIException/) is
3333

3434
---
3535

36-
!!! important "New in v0.2.0"
37-
APIException **v0.2.0** introduces major improvements:
38-
- Advanced structured logging (`log_level`, `log_header_keys`, `extra_log_fields`)
39-
- Response headers echo (`response_headers`)
40-
- Type-safety improvements with `mypy`
41-
- APIException accepts `headers` param <br>
42-
- Cleaner import/export structure <br>
43-
- 📢 Featured in [**Python Weekly #710**](https://www.pythonweekly.com/p/python-weekly-issue-710-august-14-2025-3200567a10d37d87) 🎉
44-
45-
46-
👉 For full details and usage examples, see
47-
[**register_exception_handlers reference**](https://akutayural.github.io/APIException/usage/register_exception_handlers/)
36+
<table>
37+
<tr>
38+
<td>
39+
<strong>🆕 What’s new in v0.2.0</strong>
40+
<ul>
41+
<li>Advanced structured logging (<code>log_level</code>, <code>log_header_keys</code>, <code>extra_log_fields</code>)</li>
42+
<li>Response headers echo (<code>response_headers</code>)</li>
43+
<li>Type-safety improvements with <strong>mypy</strong></li>
44+
<li><code>APIException</code> now accepts <code>headers</code> param</li>
45+
<li>Cleaner import/export structure</li>
46+
<li>📰 Featured in <strong>Python Weekly #710</strong></li>
47+
</ul>
48+
<p>👉 For full details &amp; examples: <a href="https://akutayural.github.io/APIException/usage/register_exception_handlers/"><strong>register_exception_handlers reference</strong></a></p>
49+
</td>
50+
</tr>
51+
</table>
4852

4953
---
5054

0 commit comments

Comments
 (0)