High-Performance Python Logging

Ultra Fast Thread-Safe Async Ready

A modern logging library with buffered writes, beautiful console output, structured logging, and extensive integrations.

Tamga terminal output

Modern Features

Ultra-Fast Performance

Buffered writing system delivers dramatically faster performance than traditional logging.

🔒

Thread-Safe

Locked buffer operations ensure safe concurrent logging from multiple threads.

🎨

Beautiful Output

Colorful console logs using Tailwind CSS palette with 10+ predefined log levels.

📊

Structured Logging

Log with key-value data on any log level for better analysis and monitoring.

📁

Multiple Outputs

Console, File, JSON, SQLite, MongoDB, and 80+ notification services via Apprise.

🔄

Smart Rotation

Automatic file rotation with timestamped backups when size limits are reached.

Blazing Fast Performance

Buffered Writing System

Tamga's buffered architecture delivers exceptional performance by batching write operations. Configure buffer size based on your needs:

🎯

Real-time: bufferSize=1

Immediate writes for monitoring

🌐

Web Apps: bufferSize=50

Balanced performance (default)

⚙️

Background Jobs: bufferSize=200-500

Efficient batching

🚀

Data Processing: bufferSize=1000+

Maximum throughput

Relative Performance

Console (colored) Baseline
MongoDB (async) ~30x faster
SQLite ~50x faster
JSON (buffered) ~80x faster
File (buffered) ~100x faster

* Relative to colored console output. Actual performance depends on system configuration.

Quick Start & Examples

Installation Options

pip install tamga                  # Basic installation
pip install tamga[mongo]           # With MongoDB support
pip install tamga[notifications]   # With notification support
pip install tamga[all]             # All features
# Quick start
from tamga import Tamga

logger = Tamga()
logger.info("Application started")
logger.success("Task completed!")
# Initialize with colored output
from tamga import Tamga

logger = Tamga(
    file_output=True,
    json_output=True,
    console_output=True,
    buffer_size=50,  # Buffer 50 logs before writing
)

# All available log levels
logger.info("Connected to database")              # Sky blue
logger.warning("High memory usage: 85%")          # Amber
logger.error("Connection failed")                 # Rose
logger.success("Task completed")                  # Emerald
logger.debug("Processing request #1234")          # Indigo
logger.critical("System overload!")               # Red
logger.database("Query executed: SELECT *")       # Green
logger.metric("Response time: 125ms")             # Cyan
logger.trace("Entering function: process()")      # Gray
logger.notify("Payment received: $99.99")         # Purple - sends notification

# Key-value logging works on any level
logger.info("Database connected", host="localhost", port=5432)
logger.error("Payment failed", user_id="usr_123", amount=99.99)

# Custom logging with your own color
logger.custom("Deploy completed", "DEPLOY", "purple")
logger.custom("Cache miss", "CACHE", "orange")

# Force write buffered logs
logger.flush()

Log Levels Reference

logger.info()

General information messages

logger.warning()

Warning messages

logger.error()

Error messages

logger.success()

Success messages

logger.debug()

Debug information

logger.critical()

Critical issues

logger.database()

Database operations

logger.notify()

Send notifications

logger.metric()

Performance metrics

logger.trace()

Detailed trace info

Any level + key-value

Structured key-value data

logger.custom()

Custom level & color

Ready to Level Up Your Logging?

Join thousands of developers using Tamga for faster, more beautiful, and more powerful Python logging.