Simple logs supressor and filter
Project description
shushlog
Async-compatible, dependency-less, simple log suppression and filtering lib
Install
pip install shushlog
TLDR
- supress all logs
>>> import logging
>>> import shush
>>> logging.basicConfig()
>>> logger = logging.getLogger("some_logger")
>>> logger.setLevel(logging.INFO)
>>> @shush.suppress
>>> def suppressed_func():
>>> logger.info("this should not be logged")
>>> def normal_func():
>>> logger.info("this should be logged")
>>> suppressed_func()
>>> normal_func()
INFO:some_logger:this should be logged
- muzzle text
>>> import logging
>>> import shush
>>> logging.basicConfig()
>>> logger = logging.getLogger("some_logger")
>>> logger.setLevel(logging.INFO)
>>> @shush.muzzle("foo")
>>> def muzzled_func():
>>> logger.info("this contains `foo`, so it should be muzzled out")
>>> logger.info("this doesn't contain it, so it should be showing")
>>> muzzled_func()
INFO:some_logger:this doesn't contain it, so it should be showing
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
shushlog-0.1.1.tar.gz
(14.6 kB
view hashes)
Built Distribution
shushlog-0.1.1-py3-none-any.whl
(15.3 kB
view hashes)