High-performance structured logging library with component tracking and visualization
Telelog is a Rust-first logging library that combines structured logging, performance profiling, and architectural visualization. It provides rich console output and generates Mermaid diagrams to help you understand your application's execution flow.
Features
- Performance Profiling - Automatic timing with RAII guards and context managers
- Component Tracking - Track architectural components and their relationships
- Visualization - Generate Mermaid flowcharts, timelines, and Gantt charts
- Context Management - Add persistent context to all log messages
- Rich Console Output - Clean, colored output for development
- Python Bindings - Use from Python with Rust-backed performance
- High Performance - Thread-local buffer pooling reduces allocations (~788ns per log)
- Async Support - Bounded async channels with backpressure (requires
async
feature)
Example Visualizations
Quick Start
Rust
use Logger;
let logger = new;
// Basic logging
logger.info;
logger.warning;
// Context management
logger.add_context;
logger.info; // Includes context
// Performance profiling
// Automatically logs duration
// Component tracking
Python
# Install via pip
=
# Basic logging with context
# Performance profiling
# Your operation here
pass
# Component tracking with visualization
# Generate flowchart
=
Visualization
Generate Mermaid diagrams from component tracking:
use ;
let logger = new;
// Track nested components
// Generate visualization
let tracker = logger.get_component_tracker;
let config = new.with_chart_type;
let generator = new;
let diagram = generator.generate_diagram?;
Supported chart types:
- Flowchart - Component relationships and dependencies
- Timeline - Execution order and timing
- Gantt - Component durations and overlaps
View generated diagrams at mermaid.live or in VS Code with the Mermaid extension.
Documentation
📖 Comprehensive documentation is available in the Telelog Wiki
The wiki includes:
- Getting started guides for both Rust and Python
- Detailed feature documentation (profiling, component tracking, visualization)
- Configuration and customization guides
- Cookbook with real-world examples
- Framework integration guides (Flask, FastAPI, Axum, Actix, etc.)
- Complete API references
- Migration guides from other logging libraries
- Troubleshooting and FAQ
Examples
See the examples/
directory for comprehensive usage examples in both Rust and Python.
# Try the examples
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. See the examples directory for comprehensive usage patterns.
License
This project is licensed under the MIT License.
Built with ❤️ by Vedant Asati