Advanced Python logging with tracing, coloring and FastAPI integration
Project description
Chromatrace
Chromatrace is a Python package designed for advanced logging capabilities, including trace and request ID management. It provides a flexible logging configuration and supports colored logging for better visibility.
Features
- Configurable logging settings using Pydantic.
- Support for trace IDs and request IDs.
- Customizable log formats and handlers.
- Asynchronous and synchronous function tracing.
Installation
You can install Chromatrace via pip:
pip install chromatrace
Usage
To use Chromatrace in your application, you can import the necessary components:
from chromatrace import LoggingSettings, LoggingConfig, tracer
Configure your logging settings:
logging_config = LoggingConfig(
settings=LoggingSettings(),
application_level='Development',
enable_tracing=True,
ignore_nan_trace=True
)
logger = logging_config.get_logger(__name__)
Use the tracer decorator to trace your functions:
@tracer
async def my_async_function():
# Your code here
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chromatrace-0.1.2.tar.gz.
File metadata
- Download URL: chromatrace-0.1.2.tar.gz
- Upload date:
- Size: 31.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fc605e078eb40801c803783d6966ec1f0a44593f7860d2fe4d99becfe4ea146
|
|
| MD5 |
154a19be611f29ccb24740078b20dff2
|
|
| BLAKE2b-256 |
9de09214bc768af6d2d0ac3b60e98941bad71ef7e0dead0312a62356f495a7b9
|
File details
Details for the file chromatrace-0.1.2-py3-none-any.whl.
File metadata
- Download URL: chromatrace-0.1.2-py3-none-any.whl
- Upload date:
- Size: 29.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58098ed0ba8bf07d3c9b668e70a4c77f63e5c4063682f3d4e1653ed1ebf36ea5
|
|
| MD5 |
d21d4c1630da22307395eeb6e2ed115f
|
|
| BLAKE2b-256 |
275ffba7b055d5704b1c3707224f401638c854289d3a1efeb30dd964c3f53a25
|