Metadata-Version: 2.4
Name: logging-extended-handlers
Version: 0.2.1
Summary: Extending logging.handlers
Project-URL: Changelog, https://github.com/m-birke/logging-extended-handlers/blob/main/CHANGELOG.md
Project-URL: Documentation, https://github.com/m-birke/logging-extended-handlers#readme
Project-URL: Homepage, https://github.com/m-birke/logging-extended-handlers
Project-URL: Issues, https://github.com/m-birke/logging-extended-handlers/issues
Project-URL: Source, https://github.com/m-birke/logging-extended-handlers
Author-email: m-birke <wesci@web.de>
License-Expression: MIT
License-File: LICENSE
Keywords: handlers,header,headers,http,log,log handlers,logging,logging handlers,mail,smtp
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
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 :: Implementation :: CPython
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# logging-extended-handlers

|     |     |
| --- | --- |
| Version | [![PyPI - Version](https://img.shields.io/pypi/v/logging-extended-handlers.svg)](https://pypi.org/project/logging-extended-handlers) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/logging-extended-handlers.svg)](https://pypi.org/project/logging-extended-handlers) |
| Project | ![GitHub License](https://img.shields.io/github/license/m-birke/logging-extended-handlers) ![PyPI - Status](https://img.shields.io/pypi/status/logging-extended-handlers) ![PyPI - Format](https://img.shields.io/pypi/format/logging-extended-handlers) ![PyPI - Implementation](https://img.shields.io/pypi/implementation/logging-extended-handlers) |
| CI | ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/m-birke/logging-extended-handlers/static-code-check.yml) |
| Code | ![PyPI - Types](https://img.shields.io/pypi/types/logging-extended-handlers) [![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/) [![Linting: Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) |

-----

Extending logging.handlers

## Table of Contents

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

## About

This package contains the following loggers:

- `HTTPHandlerCustomHeader`: Like `logging.handlers.HTTPHandler` but with full freedom of the HTTP header
- `BufferingSMTPHandler`: Buffers the logs like `logging.handlers.BufferingHandler` and sends it via smtp

Similar projects with differen handlers:

- [logging-nice-handlers](https://pypi.org/project/logging-nice-handlers/)
- [external-logging-handlers](https://pypi.org/project/external-logging-handlers/)
- [aws-logging-handlers](https://pypi.org/project/aws-logging-handlers/)
- []()

## Installation

```console
pip install logging-extended-handlers
```

## Usage

```python
logger = logging.getLogger()
logger.setLevel("DEBUG")
my_logger = MyLogger(...)
my_logger.setLevel("INFO")
my_formatter = logging.Formatter(
    fmt="%(asctime)s %(levelname)s by %(funcName)s: %(message)s",
    datefmt="%Y-%m-%d %H:%M:%S",
    style="%",
)
my_logger.setFormatter(my_formatter)
logger.addHandler(my_logger)
```

## License

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