Make practical Python logging easy (and developers happy!)
Project description
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34a972c65ea81c52f340b036f5b42bbbacda74517179fbdbf054b2a503d8bfd2
|
|
| MD5 |
8c2dc7b6cbd1c2822d1f394826501056
|
|
| BLAKE2b-256 |
0bb687528669656024127b907713e962a1582a305abd38e49052191e38dde031
|
Provenance
The following attestation bundles were made for happy_python_logging-0.0.8.tar.gz:
Publisher:
publish.yml on ftnext/happy-python-logging
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
happy_python_logging-0.0.8.tar.gz -
Subject digest:
34a972c65ea81c52f340b036f5b42bbbacda74517179fbdbf054b2a503d8bfd2 - Sigstore transparency entry: 910753932
- Sigstore integration time:
-
Permalink:
ftnext/happy-python-logging@2cb795adf41b78e1c5c086e36bd48ca5733f49a4 -
Branch / Tag:
refs/tags/0.0.8 - Owner: https://github.com/ftnext
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2cb795adf41b78e1c5c086e36bd48ca5733f49a4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file happy_python_logging-0.0.8-py3-none-any.whl.
File metadata
- Download URL: happy_python_logging-0.0.8-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8df6e0a599508592d524270756e6e63a982f7105f54b869cb384047ef5486f8
|
|
| MD5 |
224edb08b60159e6ef402e27b43a459c
|
|
| BLAKE2b-256 |
ffe754295817f7efa575bc041cfbaa11303e5dcd919f7831d9043047e52129ad
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
happy_python_logging-0.0.8-py3-none-any.whl -
Subject digest:
c8df6e0a599508592d524270756e6e63a982f7105f54b869cb384047ef5486f8 - Sigstore transparency entry: 910753936
- Sigstore integration time:
-
Permalink:
ftnext/happy-python-logging@2cb795adf41b78e1c5c086e36bd48ca5733f49a4 -
Branch / Tag:
refs/tags/0.0.8 - Owner: https://github.com/ftnext
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2cb795adf41b78e1c5c086e36bd48ca5733f49a4 -
Trigger Event:
release
-
Statement type: