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 details)
Built Distribution
File details
Details for the file log-throttling-0.0.3.tar.gz
.
File metadata
- Download URL: log-throttling-0.0.3.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df714e1448cd9cb4c916cf668ab88323032e61ece733548708d996ecf63190b9 |
|
MD5 | 4a11908bc682954180452ca99bec8696 |
|
BLAKE2b-256 | 76be09fda383d82a7b91f12ff5002bc909e101769c802ff3b1d2cb9f533d1a2f |
File details
Details for the file log_throttling-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: log_throttling-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a82508f489dd44a60b737a0339c784dd8ee2b9db16bdcf587a8ae1012a7f6ffc |
|
MD5 | a0052680d4a1966db4b3ccb2b163a570 |
|
BLAKE2b-256 | b16e995ebad4ab08250b4afe1d91fe3086b863ed9bb74539d90485250a50f08a |