feat: Add colorized request logging

This commit is contained in:
danielvici123
2026-06-09 20:13:39 +02:00
parent 36a3b96c12
commit 520fd4f1e6
5 changed files with 59 additions and 20 deletions

View File

@@ -7,7 +7,10 @@ DHL is a lightweight, configurable HTTP/HTTPS mock server built with Rust and Ax
- **Live Configuration Reloading**: Changes to `config.json` (routes, status codes, etc.) and response files are applied immediately without restarting the server.
- **Multi-Route Support**: Define as many paths as you need.
- **JSON Response Files**: Responses are loaded from external JSON files.
- **Request Logging**: Detailed logging of incoming requests, including methods, paths, and headers.
- **Colorized Request Logging**: Detailed logging of incoming requests with terminal colors. Status codes are color-coded for quick identification:
- <span style="color:green">**2xx Success**</span>: Green
- <span style="color:yellow">**4xx Client Error**</span>: Yellow
- <span style="color:red">**5xx Server Error**</span>: Red
- **Header Masking**: Sensitive headers like `Authorization` can be masked in logs.
- **HTTPS/TLS Support**: Optional TLS support for secure connections.
- **Automatic Default Generation**: Creates default configuration and response files if they are missing.