Skip to main content

Reusable Python Utilities by McCool

Project description

codecov docs PyPI - Version GitHub version

Installation

  • pip install pymccool

Usage

  • For basic, no-nonsense console and file logging:

    from pymccool.logging import Logger
    logger = Logger(app_name="<your app name>")
    
  • For more options, use LoggerKwargs

    from pymccool.logging import Logger, LoggerKwargs
    logger = Logger(
            LoggerKwargs(
                app_name="test_logger_loki",
                default_level=Logger.VERBOSE,
                stream_level=Logger.VERBOSE,
                grafana_loki_endpoint="https://loki.end.point.com/loki/api/v1/push")
    )
    
  • To use the Tracer:

    from uuid import uuid1
    from pymccool.tracing import get_tracer, get_decorator
    from pymccool.logging import Logger, LoggerKwargs
    logger = Logger(
            LoggerKwargs(
                app_name="test_logger_loki",
                default_level=Logger.VERBOSE,
                stream_level=Logger.VERBOSE,
                grafana_loki_endpoint="https://loki.end.point.com/loki/api/v1/push")
    )
    tracer = get_tracer(service_name="test_tracer",
                        endpoint="https://otel-rec.end.point.com/v1/traces",
                        uuid=UUID)
    instrument_decorator = get_decorator(e2e_tracer)
    

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

pymccool-0.4.2.tar.gz (16.9 kB view hashes)

Uploaded Source

Built Distribution

pymccool-0.4.2-py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 3

Supported by

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