Skip to main content

Make practical Python logging easy (and developers happy!)

Project description

happy-python-logging

Make practical Python logging easy.

PyPI - Version PyPI - Python Version


Table of Contents

Installation

pip install happy-python-logging

Usage

For library developers

getLoggerForLibrary()

happy_python_logging.getLoggerForLibrary()

-import logging
+from happy_python_logging import getLoggerForLibrary

-logger = logging.getLogger(__name__)
-logger.addHandler(logging.NullHandler())
+logger = getLoggerForLibrary(__name__)

See example for detail.

OrFilter

happy_python_logging.lib.filters.OrFilter

import logging

from happy_python_logging.lib.filters import OrFilter

root_logger = logging.getLogger()
root_logger.setLevel(logging.DEBUG)
stream_handler = logging.StreamHandler()
stream_handler.addFilter(OrFilter("libA", "libB"))
root_logger.addHandler(stream_handler)
DEBUG | libA:libA_awesome:8 - awesome
DEBUG | libB:libB_fabulous:12 - fabulous

You can combine OrFilter with logging.Filter using the | operator:

OrFilter("libA", "libB") | logging.Filter("app.important")
# reverse order also supported

License

happy-python-logging is distributed under the terms of the MIT license.

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

happy_python_logging-0.0.8.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

happy_python_logging-0.0.8-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file happy_python_logging-0.0.8.tar.gz.

File metadata

  • Download URL: happy_python_logging-0.0.8.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for happy_python_logging-0.0.8.tar.gz
Algorithm Hash digest
SHA256 34a972c65ea81c52f340b036f5b42bbbacda74517179fbdbf054b2a503d8bfd2
MD5 8c2dc7b6cbd1c2822d1f394826501056
BLAKE2b-256 0bb687528669656024127b907713e962a1582a305abd38e49052191e38dde031

See more details on using hashes here.

Provenance

The following attestation bundles were made for happy_python_logging-0.0.8.tar.gz:

Publisher: publish.yml on ftnext/happy-python-logging

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file happy_python_logging-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for happy_python_logging-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c8df6e0a599508592d524270756e6e63a982f7105f54b869cb384047ef5486f8
MD5 224edb08b60159e6ef402e27b43a459c
BLAKE2b-256 ffe754295817f7efa575bc041cfbaa11303e5dcd919f7831d9043047e52129ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for happy_python_logging-0.0.8-py3-none-any.whl:

Publisher: publish.yml on ftnext/happy-python-logging

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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