Metadata-Version: 2.4
Name: happy-python-logging
Version: 0.0.6
Summary: Make practical Python logging easy (and developers happy!)
Project-URL: Documentation, https://github.com/ftnext/happy-python-logging#readme
Project-URL: Issues, https://github.com/ftnext/happy-python-logging/issues
Project-URL: Source, https://github.com/ftnext/happy-python-logging
Author-email: ftnext <takuyafjp+develop@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: log,logger,logging
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: System :: Logging
Requires-Python: >=3.10
Requires-Dist: typing-extensions
Provides-Extra: flake8
Requires-Dist: flake8; extra == 'flake8'
Description-Content-Type: text/markdown

# 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.
