Pulse Logging - Python
Installation
Installing package via pip
pip install pulse-logging
Alternatively you could install by running the setup script.
python setup.py install
Usage
Log Appender
import logging
from pulse import PulseHandler
from pulse import PulseFormatter
pulse_handler = PulseHandler("http://host.com:9001/v2/events/app")
pulse_handler.setFormatter(PulseFormatter())
pulse_handler.setLevel(logging.WARNING)
logger = logging.getLogger(__name__)
logger.setLevel(logging.WARNING)
logger.addHandler(pulse_handler)
try:
raise ValueError
except ValueError as e:
logger.exception("Bad stuff")
Logging Configuration File Example
logging.ini file contents
[loggers]
keys=root
[handlers]
keys=pulse_handler
[formatters]
keys=pulse_formatter
[logger_root]
level=WARNING
handlers=pulse_handler
[handler_pulse_handler]
class=handlers.PulseHandler
level=WARNING
formatter=pulse_formatter
args=("http://host.com:9001/v2/events/app")
[formatter_pulse_formatter]
class=pulse.PulseFormatter
main.py file contents
import logging
from logging.config import fileConfig
fileConfig("logging.ini")
logger = logging.getLogger()
try:
raise ValueError
except ValueError as e:
logger.exception("Bad stuff")
Writing Metrics
from pulse import MetricWriter
writer = MetricWriter("http://host.com:9001/v1/metrics", "kudu_table_name")
writer.gauge("key1", "r2", 0.952)
writer.close()
Metadata
Release files for pulse-logging 2.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pulse-logging-2.3.1.tar.gz | 6.8 kB | Without provenance | Details for pulse-logging-2.3.1.tar.gz |
Release files / pulse-logging-2.3.1.tar.gz
| Download URL | pulse-logging-2.3.1.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5dd174f4c96e2acb5a19932341df186bb5d31ccab57d6b480839d563a5d1f5c5
|
|
BLAKE2b-256 checksum How to use checksums |
922df1454aa498789ae25b725c5456b9cf5ac79156fde38689e31ce02d5beb0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Security for pulse-logging 2.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.