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.14.tar.gz
(14.0 kB
view details)
Built Distribution
File details
Details for the file pymccool-0.3.14.tar.gz
.
File metadata
- Download URL: pymccool-0.3.14.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 | ea1b4073e4e2969274e34d019e79043ffbecff58dbc1d649ba0dc68d0c3bee1a |
|
MD5 | d7e118504adbf7c9f108d67cc300cbb9 |
|
BLAKE2b-256 | d29e3f03f324ae6924526fd487b4f32906472c16070e28734376c5f54738bce6 |
File details
Details for the file pymccool-0.3.14-py3-none-any.whl
.
File metadata
- Download URL: pymccool-0.3.14-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 | 4e7e2453ea476f2d0e309a06b121818fb3fc5936e518d9d6c9d84343ef649ee1 |
|
MD5 | 959ece76c3ff652b8fb63e308a221cf1 |
|
BLAKE2b-256 | b1f05b9f9142ed785a8eebd563ecbd59df7d11747879b6ba9ed097ec9f5eb6c4 |