Skip to main content

Simple logs supressor and filter

Project description

shushlog

PyPI PyPI - License PyPI - Python Version pdm-managed

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


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 details)

Uploaded Source

Built Distribution

shushlog-0.1.1-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file shushlog-0.1.1.tar.gz.

File metadata

  • Download URL: shushlog-0.1.1.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.9.3 CPython/3.9.4

File hashes

Hashes for shushlog-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1eb3d43cdd2454b3f2724f6940350f15b8bcc005ae39c737767e3a79176602d4
MD5 0b0fd2764a95c77698988a67aaf65273
BLAKE2b-256 fa4ea7d94b2e11a6e20d42a82ca9b0842aae35424446754da45ec73720d37052

See more details on using hashes here.

File details

Details for the file shushlog-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: shushlog-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.9.3 CPython/3.9.4

File hashes

Hashes for shushlog-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f0a5dd6c879dc85d498550d88c2ea728ecb1882b2199a269a2202dc33699cf0
MD5 445631dc7691760c918148942abb9f9b
BLAKE2b-256 c1c74d028d86d1704903e15d0a0d7e2315d6d3b6a2df0484023fe5949c966af9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page