happy-python-logging


Namehappy-python-logging JSON
Version 0.0.4 PyPI version JSON
download
home_pageNone
SummaryMake practical Python logging easy (and developers happy!)
upload_time2025-09-03 11:51:59
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords log logger logging
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # happy-python-logging

Make practical Python logging easy.

[![PyPI - Version](https://img.shields.io/pypi/v/happy-python-logging.svg)](https://pypi.org/project/happy-python-logging)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/happy-python-logging.svg)](https://pypi.org/project/happy-python-logging)

-----

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [License](#license)

## Installation

```console
pip install happy-python-logging
```

## Usage

### For library developers

#### `getLoggerForLibrary()`

`happy_python_logging.getLoggerForLibrary()`

```diff
-import logging
+from happy_python_logging import getLoggerForLibrary

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

See [`example`](https://github.com/ftnext/happy-python-logging/tree/main/example) for detail.

#### `OrFilter`

`happy_python_logging.lib.filters.OrFilter`

```python
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
```

## License

`happy-python-logging` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "happy-python-logging",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "log, logger, logging",
    "author": null,
    "author_email": "ftnext <takuyafjp+develop@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/0f/36/0d86912709ea79b2fe168b9594453432185f0e9191aca83851379b04e75d/happy_python_logging-0.0.4.tar.gz",
    "platform": null,
    "description": "# happy-python-logging\n\nMake practical Python logging easy.\n\n[![PyPI - Version](https://img.shields.io/pypi/v/happy-python-logging.svg)](https://pypi.org/project/happy-python-logging)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/happy-python-logging.svg)](https://pypi.org/project/happy-python-logging)\n\n-----\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [License](#license)\n\n## Installation\n\n```console\npip install happy-python-logging\n```\n\n## Usage\n\n### For library developers\n\n#### `getLoggerForLibrary()`\n\n`happy_python_logging.getLoggerForLibrary()`\n\n```diff\n-import logging\n+from happy_python_logging import getLoggerForLibrary\n\n-logger = logging.getLogger(__name__)\n-logger.addHandler(logging.NullHandler())\n+logger = getLoggerForLibrary(__name__)\n```\n\nSee [`example`](https://github.com/ftnext/happy-python-logging/tree/main/example) for detail.\n\n#### `OrFilter`\n\n`happy_python_logging.lib.filters.OrFilter`\n\n```python\nimport logging\n\nfrom happy_python_logging.lib.filters import OrFilter\n\nroot_logger = logging.getLogger()\nroot_logger.setLevel(logging.DEBUG)\nstream_handler = logging.StreamHandler()\nstream_handler.addFilter(OrFilter(\"libA\", \"libB\"))\nroot_logger.addHandler(stream_handler)\n```\n\n```\nDEBUG | libA:libA_awesome:8 - awesome\nDEBUG | libB:libB_fabulous:12 - fabulous\n```\n\n## License\n\n`happy-python-logging` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Make practical Python logging easy (and developers happy!)",
    "version": "0.0.4",
    "project_urls": {
        "Documentation": "https://github.com/ftnext/happy-python-logging#readme",
        "Issues": "https://github.com/ftnext/happy-python-logging/issues",
        "Source": "https://github.com/ftnext/happy-python-logging"
    },
    "split_keywords": [
        "log",
        " logger",
        " logging"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a40dece1ef829f87cfe3ebe8e561b45fac57477e6a847de2a2d58606f2daf2f9",
                "md5": "e7dac3acda8f7bfb8ee0bcbb4c179605",
                "sha256": "a7bb6e73238e696c064edeae62aaab2c9b1d09e49ab634a47be625bc2d9bda3a"
            },
            "downloads": -1,
            "filename": "happy_python_logging-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e7dac3acda8f7bfb8ee0bcbb4c179605",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 4871,
            "upload_time": "2025-09-03T11:51:58",
            "upload_time_iso_8601": "2025-09-03T11:51:58.880860Z",
            "url": "https://files.pythonhosted.org/packages/a4/0d/ece1ef829f87cfe3ebe8e561b45fac57477e6a847de2a2d58606f2daf2f9/happy_python_logging-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0f360d86912709ea79b2fe168b9594453432185f0e9191aca83851379b04e75d",
                "md5": "dfcfe0c51358d0d350a61f4abe255aa6",
                "sha256": "3978be41574df9f2c50964147c2b9d5a73a98239e381a550f8a1c901915658a9"
            },
            "downloads": -1,
            "filename": "happy_python_logging-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "dfcfe0c51358d0d350a61f4abe255aa6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 5987,
            "upload_time": "2025-09-03T11:51:59",
            "upload_time_iso_8601": "2025-09-03T11:51:59.986969Z",
            "url": "https://files.pythonhosted.org/packages/0f/36/0d86912709ea79b2fe168b9594453432185f0e9191aca83851379b04e75d/happy_python_logging-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-03 11:51:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ftnext",
    "github_project": "happy-python-logging#readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "happy-python-logging"
}
        
Elapsed time: 2.05165s