happy-python-logging
Make practical Python logging easy.
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
CLI: happy-python-logging run (experimental)
Run any Python script with quick library-level logging — RUST_LOG style:
$ happy-python-logging run example_script.py --log-config httpx=debug
Multiple loggers can be set at once, comma-separated:
$ happy-python-logging run example_script.py --log-config httpx=debug,urllib3=info
The same spec can be supplied via the PYTHON_LOG environment variable:
$ PYTHON_LOG=httpx=debug happy-python-logging run example_script.py
A bare level (e.g. --log-config debug) sets the root logger.
The StreamHandler (stderr) and Formatter are fixed — the goal is to get
library logs onto the console with one flag.
License
happy-python-logging is distributed under the terms of the MIT license.
Metadata
Release files for happy-python-logging 0.0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| happy_python_logging-0.0.10.tar.gz | 19.5 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| happy_python_logging-0.0.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.1 kB
Release files / happy_python_logging-0.0.10.tar.gz
| Download URL | happy_python_logging-0.0.10.tar.gz |
|---|---|
| Size | 19.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e01e3451637b86090940ca0934531bc515c8f15c6005a029c0b84991ad873f8f
|
|
BLAKE2b-256 checksum How to use checksums |
9d45af7f48217f2d541619f29eaaa384e20a9b3edbd92a9c9172ade11b885893
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.
Transparency logRelease files / happy_python_logging-0.0.10-py3-none-any.whl
| Download URL | happy_python_logging-0.0.10-py3-none-any.whl |
|---|---|
| Size | 13.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
91d3deb0ddaec5fcca1d46eb57e4a99cc66fdf95c192c14e5804c42444ccfcf6
|
|
BLAKE2b-256 checksum How to use checksums |
8deccc08b43fe30420b44ef9588e1efc4f69af439a92c5cb19c23fedd7de56e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.
Transparency logSecurity for happy-python-logging 0.0.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for happy_python_logging-0.0.10.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.