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.0.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.0-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

Details for the file chromatrace-0.1.0.tar.gz.

File metadata

  • Download URL: chromatrace-0.1.0.tar.gz
  • Upload date:
  • Size: 31.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for chromatrace-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8de17bee705a81b2eb8d2c170bb07b3e52b1bd8513e1ea24db652a578bf605ef
MD5 480c1fd4928d353b3807bb60d20f339c
BLAKE2b-256 44436a3a99c569e76d191b8f5e9be7373ce718a97cf47f96dcb28842a399751f

See more details on using hashes here.

File details

Details for the file chromatrace-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: chromatrace-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 29.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for chromatrace-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e99ef7d4e8dad7031db74e802588ba54ab4b4bef05cdbed97ff6b15c4cb8f92b
MD5 e454e844653c02595f9d376e9592478f
BLAKE2b-256 1969d4c8b33bdcd87dab4457c9e6184eedc5b9e54fea59e4a2447be05c52b1d3

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