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.3.16.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

pymccool-0.3.16-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file pymccool-0.3.16.tar.gz.

File metadata

  • Download URL: pymccool-0.3.16.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pymccool-0.3.16.tar.gz
Algorithm Hash digest
SHA256 b24b769d88e263814cb248fc5332a9202ce894cba04f59b3c9c69c50c0e1eb47
MD5 6084f3f71237f50c499105babe1f310c
BLAKE2b-256 bf08c418dab5fc7b8cdff25d11ac827262374bed248ef8afe784981c8f9613cf

See more details on using hashes here.

File details

Details for the file pymccool-0.3.16-py3-none-any.whl.

File metadata

  • Download URL: pymccool-0.3.16-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pymccool-0.3.16-py3-none-any.whl
Algorithm Hash digest
SHA256 b425533b0fb7b29444e65563fc2ae685a010e0e3739a313f659f745a9603e110
MD5 0a5ff290401ba70a3b0ffd69209e5aa6
BLAKE2b-256 56546bb96d20101333cce9ca5c1754cf35b37f0c9a5f15a1466c289bbdd5ab1f

See more details on using hashes here.

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