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.2.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for log_throttling-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0e9c8c8922e433cbba02ff846a64222a89174bd4dab5e2aa5f58d0e956d794d |
|
MD5 | 856a8dfbddd3cffd28b40728b62f867f |
|
BLAKE2b-256 | 4d302a7f057f76f9a1e248f883c794751236685ebcf3073637ef66c8d3d2a702 |