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.15.tar.gz
(14.1 kB
view details)
Built Distribution
File details
Details for the file pymccool-0.3.15.tar.gz
.
File metadata
- Download URL: pymccool-0.3.15.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e639aea7c5c7510c6058e97a89d5c96eabb8d322fc20983df307dc56956f3b31 |
|
MD5 | 858d0e8620a67c055be8aa9fd6180f27 |
|
BLAKE2b-256 | 3a5ee6c8a5dc44a77fa37a5b05f39dedf768e5bd9fccdbb3eab514f1ee5a417e |
File details
Details for the file pymccool-0.3.15-py3-none-any.whl
.
File metadata
- Download URL: pymccool-0.3.15-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | bde16c7c7718d7ff0404289345d2d580746425bcaa92582bfae4be1ca69fdde6 |
|
MD5 | 7572507b2e54afe6385c57afd7e057af |
|
BLAKE2b-256 | 519bab117d118201ca624dd874bf7315908a88487b00b604e7961c228ab467a1 |