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.1.tar.gz
(16.7 kB
view details)
Built Distribution
File details
Details for the file pymccool-0.4.1.tar.gz
.
File metadata
- Download URL: pymccool-0.4.1.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a702eeed97b86f3e57b6a6384db516678b3d684b05b2aea0bdb7651f4dcbcc10 |
|
MD5 | 69fb98e00bee1f77920f6d32c223af7f |
|
BLAKE2b-256 | 7e742265b68c41c940c444451b2c528335ccc9af5c24a787801f0d65cd0a9eac |
File details
Details for the file pymccool-0.4.1-py3-none-any.whl
.
File metadata
- Download URL: pymccool-0.4.1-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.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65ae7ba724612aa967308960d59c5a816bb166a157c3cee68e4d65a988c2e9eb |
|
MD5 | 0401a47a5baf39c28b8a0564571d0186 |
|
BLAKE2b-256 | d0d46d32b6e589121d88db7296da1025b01010a1f8046882544f809c7582fc8d |