A modern logging library with buffered writes, beautiful console output, structured logging, and extensive integrations.
Buffered writing system delivers dramatically faster performance than traditional logging.
Locked buffer operations ensure safe concurrent logging from multiple threads.
Colorful console logs using Tailwind CSS palette with 10+ predefined log levels.
Log with key-value data on any log level for better analysis and monitoring.
Console, File, JSON, SQLite, MongoDB, and 80+ notification services via Apprise.
Automatic file rotation with timestamped backups when size limits are reached.
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 to colored console output. Actual performance depends on system configuration.
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()
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
Join thousands of developers using Tamga for faster, more beautiful, and more powerful Python logging.