Skip to content

m-birke/logging-extended-handlers

Repository files navigation

logging-extended-handlers

Version PyPI - Version PyPI - Python Version
Project GitHub License PyPI - Status PyPI - Format PyPI - Implementation
CI GitHub Actions Workflow Status
Code PyPI - Types Checked with mypy Linting: Ruff Code style: black

Extending logging.handlers

Table of Contents

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:

Installation

pip install logging-extended-handlers

Usage

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

About

Extending logging.handlers

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors