Quick Start Guideยถ
This guide will get you up and running with LogEverything in 5 minutes.
๐โโ๏ธ Zero Configuration Startยถ
LogEverything works immediately with zero configuration:
from logeverything import Logger
# Create a logger - auto-detects your environment
log = Logger("my_app")
# Start logging immediately
log.info("Application started")
log.warning("This is a warning")
log.error("Something went wrong")
log.debug("Debug information")
Output:
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | my_app | Application started
2026-05-01 05:38:53 | [โ ๏ธ WARNING ] | my_app | This is a warning
2026-05-01 05:38:53 | [ โ ERROR ] | my_app | Something went wrong
2026-05-01 05:38:53 | [ ๐ DEBUG ] | my_app | Debug information
- What happened?
LogEverything auto-detected your environment (script/web/notebook)
Applied optimal defaults for your context
Provided beautiful, readable output
โก Smart Decoratorsยถ
Add automatic function logging with a single decorator:
from logeverything.decorators import log
@log
def calculate_total(items, tax_rate=0.1):
"""Calculate total with tax."""
subtotal = sum(items)
tax = subtotal * tax_rate
return subtotal + tax
# Function execution is automatically logged
total = calculate_total([10.99, 5.99, 15.99], tax_rate=0.08)
print(f"Total: ${total:.2f}")
Output:
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | decorator_temp | ๐ต CALL calculate_total(items=[10.99, 5.99, 15.99], tax_rate=0.08) [tmpeps_fd80.py:56]
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | decorator_temp | โ
DONE calculate_total (4.19ms) โ 35.6076
Total: $35.61
- What the decorator does:
Logs function entry with arguments
Logs execution time
Logs return value
Handles exceptions automatically
Automatically finds the best available logger
๐ฏ Targeted Logging with Specific Loggersยถ
Use the using parameter to target specific loggers:
from logeverything import Logger
from logeverything.decorators import log
# Create specialized loggers
api_logger = Logger("API", level="INFO")
db_logger = Logger("Database", level="DEBUG")
@log(using="API") # Use the API logger
def fetch_user_data(user_id):
"""Fetch user data from API."""
return {"id": user_id, "name": f"User {user_id}"}
@log(using="Database") # Use the Database logger
def save_user_data(user_data):
"""Save user data to database."""
return f"Saved user {user_data['id']}"
# Each function uses its specified logger
user = fetch_user_data(123)
result = save_user_data(user)
print(f"Operation completed: {result}")
Output:
Operation completed: Saved user 123
- Benefits of explicit logger selection:
Route different operations to appropriate loggers
Control log levels per component
Better organization and filtering
Clear separation of concerns
๐ Async Applicationsยถ
For async applications, use AsyncLogger for 6.8x better performance:
import asyncio
from logeverything.asyncio import AsyncLogger
async def fetch_user_data(user_id):
"""Simulate fetching user data."""
log = AsyncLogger("user_service")
user_log = log.bind(user_id=user_id)
user_log.info("Fetching user data")
await asyncio.sleep(0.1) # Simulate async operation
user_data = {"id": user_id, "name": f"User {user_id}"}
user_log.info("User data retrieved")
return user_data
# Process multiple users concurrently
users = await asyncio.gather(
fetch_user_data(1),
fetch_user_data(2),
fetch_user_data(3)
)
print(f"Retrieved {len(users)} users")
Output:
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | user_service | [user_id=1] Fetching user data
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | user_service | [user_id=2] Fetching user data
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | user_service | [user_id=3] Fetching user data
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | user_service | [user_id=1] User data retrieved
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | user_service | [user_id=2] User data retrieved
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | user_service | [user_id=3] User data retrieved
Retrieved 3 users
๐ง Intelligent Type Castingยถ
LogEverything automatically handles sync/async logger and function mismatches:
import asyncio
from logeverything import Logger # Sync logger
from logeverything.decorators import log
# Create a sync logger
sync_logger = Logger("mixed_app")
@log(using="mixed_app") # Sync logger with async function - automatically handled!
async def async_process(data):
"""Async function using sync logger - works seamlessly."""
await asyncio.sleep(0.1)
return f"processed_{data}"
@log(using="mixed_app") # Same logger works with sync functions too
def sync_validate(result):
"""Sync function using the same logger."""
return len(result) > 5
# Both functions work with the same logger regardless of sync/async nature
result = await async_process("data")
is_valid = sync_validate(result)
print(f"Result: {result}, Valid: {is_valid}")
Output:
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | mixed_app_async_shared | ๐ต CALL async_process(data='data') [base_events.py:1936]
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | mixed_app_async_shared | โ
DONE async_process (100.62ms) โ 'processed_data'
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | mixed_app | ๐ต CALL _async_main.<locals>.sync_validate(result='processed_data') [base_events.py:1936]
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | mixed_app | โ
DONE _async_main.<locals>.sync_validate (4.88ms) โ True
Result: processed_data, Valid: True
- What happened?
LogEverything detected the sync logger with async function mismatch
Automatically created an async-compatible logger with same configuration
Both sync and async functions work seamlessly with intelligent casting
Zero configuration required - works transparently
๐จ Visual Enhancementยถ
Enable beautiful visual formatting:
from logeverything import Logger
# Enable visual mode for beautiful output
log = Logger("visual_demo")
log.configure(
visual_mode=True,
use_symbols=True,
use_colors=True
)
log.info("โจ Visual mode enabled")
log.warning("โ ๏ธ This is a warning")
log.error("โ Something went wrong")
log.debug("๐ Debug information")
Output:
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | visual_demo | โจ Visual mode enabled
2026-05-01 05:38:53 | [โ ๏ธ WARNING ] | visual_demo | โ ๏ธ This is a warning
2026-05-01 05:38:53 | [ โ ERROR ] | visual_demo | โ Something went wrong
2026-05-01 05:38:53 | [ ๐ DEBUG ] | visual_demo | ๐ Debug information
๐ Context Managersยถ
Use context managers for hierarchical logging:
from logeverything import Logger
log = Logger("data_processor")
log.configure(visual_mode=True, use_symbols=True)
# Context manager for hierarchical logging
with log.context("Data Processing Pipeline"):
log.info("๐ Starting pipeline")
with log.context("Data Loading"):
log.info("๐ Loading CSV files")
log.info("โ
Loaded 1,000 records")
with log.context("Data Validation"):
log.info("๐ Validating data integrity")
log.warning("โ ๏ธ Found 5 invalid records")
log.info("๐งน Cleaned invalid data")
with log.context("Data Processing"):
log.info("โ๏ธ Applying transformations")
log.info("๐ Generating statistics")
log.info("โ
Processing completed")
log.info("๐ Pipeline finished successfully")
Output:
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | data_processor | โโโบ Data Processing Pipeline
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | data_processor | ๐ Starting pipeline
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | data_processor | โโโบ Data Loading
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | data_processor | ๐ Loading CSV files
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | data_processor | โ
Loaded 1,000 records
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | data_processor | โโโ Data Loading complete
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | data_processor | โโโบ Data Validation
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | data_processor | ๐ Validating data integrity
2026-05-01 05:38:53 | [โ ๏ธ WARNING ] | data_processor | โ ๏ธ Found 5 invalid records
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | data_processor | ๐งน Cleaned invalid data
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | data_processor | โโโ Data Validation complete
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | data_processor | โโโบ Data Processing
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | data_processor | โ๏ธ Applying transformations
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | data_processor | ๐ Generating statistics
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | data_processor | โ
Processing completed
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | data_processor | โโโ Data Processing complete
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | data_processor | โโโ Data Processing Pipeline complete
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | data_processor | ๐ Pipeline finished successfully
๐ง Configuration Profilesยถ
Use pre-configured profiles for different environments:
from logeverything import Logger
# Development profile - detailed logging
dev_log = Logger("dev_app")
dev_log.configure(profile="development")
dev_log.info("Development mode logging")
# Production profile - optimized performance
prod_log = Logger("prod_app")
prod_log.configure(profile="production")
prod_log.info("Production mode logging")
Output:
05:38:53 | [ โน๏ธ INFO ] | dev_app | Development mode logging
๐ฆ Structured Loggingยถ
Add structured data to your logs:
from logeverything import Logger
log = Logger("ecommerce")
# Structured logging with bound context
user_log = log.bind(
user_id=12345,
username="john_doe",
ip_address="192.168.1.100",
session_id="abc123"
)
user_log.info("User login successful")
# Additional context binding
session_log = log.bind(user_id=12345, session_id="abc123")
product_log = session_log.bind(product_id=789, category="electronics")
product_log.info("Product viewed")
cart_log = session_log.bind(product_id=789, quantity=2)
cart_log.info("Item added to cart")
Output:
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | ecommerce | [user_id=12345 | username=john_doe | ip_address=192.168.1.100 | session_id=abc123] User login successful
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | ecommerce | [user_id=12345 | session_id=abc123 | product_id=789 | category=electronics] Product viewed
2026-05-01 05:38:53 | [ โน๏ธ INFO ] | ecommerce | [user_id=12345 | session_id=abc123 | product_id=789 | quantity=2] Item added to cart
๐ก๏ธ Error Handlingยถ
Automatic exception logging:
from logeverything import Logger
from logeverything.decorators import log
logger = Logger("error_demo")
@log
def divide_numbers(a, b):
"""Divide two numbers with automatic error logging."""
return a / b
# This will automatically log the exception
try:
result = divide_numbers(10, 0)
except ZeroDivisionError:
logger.info("Exception was automatically logged by decorator")
Output:
2026-05-01 05:38:54 | [ โน๏ธ INFO ] | error_demo | ๐ต CALL divide_numbers(a=10, b=0) [tmptzvji5xl.py:58]
2026-05-01 05:38:54 | [ โ ERROR ] | error_demo | โ FAIL divide_numbers (4.24ms): ZeroDivisionError: division by zero
2026-05-01 05:38:54 | [ โน๏ธ INFO ] | error_demo | Exception was automatically logged by decorator
๐ Web Applicationsยถ
Perfect for web frameworks:
# FastAPI Example
from fastapi import FastAPI
from logeverything import Logger
app = FastAPI()
log = Logger("api")
@app.get("/users/{user_id}")
async def get_user(user_id: int):
request_log = log.bind(endpoint="/users", user_id=user_id)
request_log.info("API request received")
# Simulate database lookup
with request_log.context("Database Lookup"):
request_log.debug("Querying user database")
# Simulated user data
user_data = {"user_id": user_id, "name": "John Doe", "email": "john@example.com"}
request_log.info("User found successfully")
request_log.bind(user_count=1).info("Returning user data")
return user_data
# Demonstrate the logging by calling the function
import asyncio
result = asyncio.run(get_user(123))
print(f"API returned: {result}")
Output:
Traceback (most recent call last):
File "/tmp/tmpx63cpy28.py", line 47, in <module>
from fastapi import FastAPI
ModuleNotFoundError: No module named 'fastapi'
โ๏ธ Next Stepsยถ
Now that youโve seen the basics, explore more advanced features:
๐ User Guide: Dive deeper into logger classes, decorators, and async logging
๐จ Visual Formatting: Learn about themes, colors, and custom formatting
โก Performance: Optimize for high-throughput applications
๐ Web Integration: Integrate with FastAPI, Django, and Flask
๐ง Configuration: Master profiles, handlers, and custom setups
Common Patterns:
# Simple application logging
from logeverything import Logger
log = Logger("my_app")
# Async application logging
from logeverything.asyncio import AsyncLogger
log = AsyncLogger("my_async_app")
# Function decoration
from logeverything.decorators import log
@log
def my_function(): pass
# Context management
with log.context("Operation"):
# code here
๐ Learn Moreยถ
Logger Classes - Master Logger and AsyncLogger
Smart Decorators - Advanced decorator usage
Async Logging - High-performance async patterns
Performance and Optimization - Performance optimization
Core API Reference - Complete API reference