Reusable Python Utilities by McCool
Project description
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
Release history Release notifications | RSS feed
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.18.tar.gz
(14.9 kB
view details)
Built Distribution
File details
Details for the file pymccool-0.3.18.tar.gz
.
File metadata
- Download URL: pymccool-0.3.18.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00d7fe476f8c7cfd935b184083e3284014e559202b87b3a124067957985bb0a5 |
|
MD5 | 7cb4f3a02f6b2b424d7b21a7e11540cc |
|
BLAKE2b-256 | e9ee48b79ff66a56a47510a1aa53c6b2c0bbb1f78e1abc283f56cacd2d459b71 |
File details
Details for the file pymccool-0.3.18-py3-none-any.whl
.
File metadata
- Download URL: pymccool-0.3.18-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.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d09e8c2b83dcce27233fc526a6cb449164f97bac1ffc9315f7385dc4c85018e2 |
|
MD5 | c2d01ed8cb483f6d02d67cbb5b743332 |
|
BLAKE2b-256 | 31b4833783e6fe3c8e4bf035a3fa6548d040874fe1e3de37b940c430a3df9cda |