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.17.tar.gz
(14.9 kB
view details)
Built Distribution
File details
Details for the file pymccool-0.3.17.tar.gz
.
File metadata
- Download URL: pymccool-0.3.17.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 904cfa6cce020bc58be96723cf95d55498689bb97ac601afcb1bda1ac87fef4b |
|
MD5 | 99fb86b43eb7bda1bec4cd3914ee325a |
|
BLAKE2b-256 | 8e1f5064869ea405861b4302b5a7bff4aa7b1c7f3cc55e154cb049f34c3b6400 |
File details
Details for the file pymccool-0.3.17-py3-none-any.whl
.
File metadata
- Download URL: pymccool-0.3.17-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 | f3c23e87a13b62936c4bc63016a6ab14c635f766a9b36177cb5541f02829efb7 |
|
MD5 | d63d7d8d55277f5ba2ddd687ba67c949 |
|
BLAKE2b-256 | a8fbb64f46505edb4ec4235cb98929f8149299818ccc15d1dd945692d155fd44 |