loggingutil

LoggingUtil Documentation

Welcome to LoggingUtil, a powerful Python logging utility that surpasses the standard library logging module.

Features

Quick Start

Installation

pip install loggingutil

Basic Usage

from loggingutil import LogFile, LogLevel

# Create a logger
logger = LogFile("app.log")

# Log messages
logger.log("Hello world", level=LogLevel.INFO)

# Add context
with logger.context(user_id="123"):
    logger.log("User action")

# Track transactions
with logger.correlation("txn-456"):
    logger.log("Processing payment")

Multiple Outputs

from loggingutil.handlers import ConsoleHandler, ElasticsearchHandler

# Add colored console output
logger.add_handler(ConsoleHandler(color=True))

# Add Elasticsearch integration
logger.add_handler(ElasticsearchHandler(
    "http://elasticsearch:9200",
    index_prefix="myapp"
))

Documentation Sections

API Reference

Complete API documentation for all LoggingUtil classes and methods.

Cloud Integration Guide

Detailed instructions for integrating with AWS CloudWatch, Elasticsearch, and other cloud services.

Changelog

Track version history, updates, and breaking changes.

Getting Help

Contributing

We welcome contributions! Please check our GitHub repository for guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.