A python log throttling utility
Project description
log-throttling
A light-weight python log throttling utility
import time
import logging
import log_throttling
logger = logging.getLogger(__name__)
start = time.monotonic()
while time.monotonic() - start < 10:
log_throttling.by_time(logger, interval=1).info(
"This line will be logged once every second."
)
time.sleep(0.01)
for i in range(100):
log_throttling.by_count(logger, once_every=10).info(
"This line will only log values that are multiples of 10: %s", i
)
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
log-throttling-0.0.1.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for log_throttling-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6c37fb009e570317b734a2ee69a384f933e35c0193ce73501220dbf4bcf834d |
|
MD5 | 2b84f6ee01d24c50ff52ec7527df897c |
|
BLAKE2b-256 | f4269ce7071d9f74f7b1970d8fe9f70cfa54005af8fe2de4979005a66f1540dd |