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.13.tar.gz
(14.0 kB
view details)
Built Distribution
File details
Details for the file pymccool-0.3.13.tar.gz
.
File metadata
- Download URL: pymccool-0.3.13.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad4b4ab62f3ecefb0198032aadcc2f0864b8cc2a996502cb1735f43babf19cd3 |
|
MD5 | e7abf26e9a1d6b679934173dc63da1aa |
|
BLAKE2b-256 | 2a509fd5202f3118b24b3ac5ca506c4d2a404020d2b6addf51504221188254ed |
File details
Details for the file pymccool-0.3.13-py3-none-any.whl
.
File metadata
- Download URL: pymccool-0.3.13-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 | 2846e8063fd8886993dcef04bd7245cc5473b7907346960b7860a11b50573710 |
|
MD5 | eb904ab5149c2aad1ff25b9fee4e9db8 |
|
BLAKE2b-256 | f730f66f25c79780e6888acd158e281478b4d15b8f97c4af4f688052f25dc7e3 |