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

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")
>>> @shush.suppress
>>> 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\n

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.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

shushlog-0.1.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: shushlog-0.1.0.tar.gz
  • Upload date:
  • Size: 14.5 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.0.tar.gz
Algorithm Hash digest
SHA256 495393bf6c3c5179028cd405f441c67899d624d1a39b5f6268d6b8ba28066ea8
MD5 41589983253f8923eee8d2d59a22498d
BLAKE2b-256 1a8bb8456c9f96475007121fb3a6432912e1dc95c1e12284f872c3a3ae643776

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shushlog-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6c785906394afd890bd7c4546fd824286d498df04dabe4973d8a6b0e1d80427
MD5 65b952c0d4678506d3d86659b21b8a18
BLAKE2b-256 517591559694cfaba7ef06930ff9fb15a4fbe678c8f6ebf28163077c5bad7833

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