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.11.tar.gz
(13.9 kB
view details)
Built Distribution
File details
Details for the file pymccool-0.3.11.tar.gz
.
File metadata
- Download URL: pymccool-0.3.11.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb5a8bca747ade7669af6cb313586663a658e4fc7c89b07c1a841a8d270ba343 |
|
MD5 | 97517a75568e8b369af6de286f8d365e |
|
BLAKE2b-256 | 2ad3d2ca5c3422edfcd22078e7aebb509b9abb2ec05809012fb3c4fa853f438f |
File details
Details for the file pymccool-0.3.11-py3-none-any.whl
.
File metadata
- Download URL: pymccool-0.3.11-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 | 0e5852525130a5cb75ae0f5a301dd5d32e1998e9a5fe140343537d821ceaa642 |
|
MD5 | 44535e9b4606956b9ead2405432aeb74 |
|
BLAKE2b-256 | 0da9ee6b5b813c33f44f74695d34b042431f1af9f322243fa6b7c9eb7500c03a |