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.3.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for log_throttling-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a82508f489dd44a60b737a0339c784dd8ee2b9db16bdcf587a8ae1012a7f6ffc |
|
MD5 | a0052680d4a1966db4b3ccb2b163a570 |
|
BLAKE2b-256 | b16e995ebad4ab08250b4afe1d91fe3086b863ed9bb74539d90485250a50f08a |