Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chromatrace-0.1.2.tar.gz (31.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chromatrace-0.1.2-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

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

Hashes for chromatrace-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6fc605e078eb40801c803783d6966ec1f0a44593f7860d2fe4d99becfe4ea146
MD5 154a19be611f29ccb24740078b20dff2
BLAKE2b-256 9de09214bc768af6d2d0ac3b60e98941bad71ef7e0dead0312a62356f495a7b9

See more details on using hashes here.

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

Hashes for chromatrace-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 58098ed0ba8bf07d3c9b668e70a4c77f63e5c4063682f3d4e1653ed1ebf36ea5
MD5 d21d4c1630da22307395eeb6e2ed115f
BLAKE2b-256 275ffba7b055d5704b1c3707224f401638c854289d3a1efeb30dd964c3f53a25

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page