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:

  1. ๐Ÿ“š User Guide: Dive deeper into logger classes, decorators, and async logging

  2. ๐ŸŽจ Visual Formatting: Learn about themes, colors, and custom formatting

  3. โšก Performance: Optimize for high-throughput applications

  4. ๐ŸŒ Web Integration: Integrate with FastAPI, Django, and Flask

  5. ๐Ÿ”ง 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ยถ