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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pymccool-0.3.12.tar.gz
  • Upload date:
  • Size: 14.0 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.12.tar.gz
Algorithm Hash digest
SHA256 00ae02b3b94951599531b27cc2c3b3bc35cb17be0729a768ba83906a9e5fab2a
MD5 f02fe53a97d2a845778f0339676e08e5
BLAKE2b-256 acc4ed5bd56c4c2254c304b875bc0aa73be6ff87b4637c695af7969c05d7dd42

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymccool-0.3.12-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.12-py3-none-any.whl
Algorithm Hash digest
SHA256 c745972c2300a0489ca74a6415bf6e75c71c371d60c97272ce7fe419494c586f
MD5 918cde3d967faa9258d925b1456c2d08
BLAKE2b-256 a882f589e139f8c24bc2c99b398f95867106d49c71bad30c088c47185a6cc561

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