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.4.2.tar.gz
(16.9 kB
view details)
Built Distribution
File details
Details for the file pymccool-0.4.2.tar.gz
.
File metadata
- Download URL: pymccool-0.4.2.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec1cdf1ef9feca791fa2972ed4fc4b44e791a9d44b9f22b6fc261cc48b31911e |
|
MD5 | d8fe41d195f168bdd982dcfc1e6f684c |
|
BLAKE2b-256 | 19c003af0a079742b2182785adc297bcf1c188952bf3b607643b794f0738c486 |
File details
Details for the file pymccool-0.4.2-py3-none-any.whl
.
File metadata
- Download URL: pymccool-0.4.2-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | feb8253263f8b6a4064241c0d23bd439e63df5f06c82f98c9a7df8ba43034c69 |
|
MD5 | aaa013b41d24763e6e1c5eb793db9f93 |
|
BLAKE2b-256 | 7ed7a60144acd866e62a47f12905671206cec0522f1cf0cb883e8b34cc7a58e4 |