How odygrd/quill works
Main Components Overview
The system should be divided into two primary components:
a) Frontend (Caller Thread):
• Logger Management
• Queue Management
• Metadata Handling
• Type-safe Formatting Interface
b) Backend (Worker Thread):
• Message Processing
• Sink Management
• Formatting Engine
• File/Console Output
Key Architectural Elements
a) Core Components:
Frontend Layer:
• Logger Interface
• SPSC Queue (Bounded/Unbounded)
• Metadata System
• Type Codec System
Backend Layer:
• Backend Worker
• Sink Manager
• Pattern Formatter
• Transit Event System
b) Sink Types:
• Console Sink
• File Sink
• Rotating File Sink
• JSON Sink
• Custom Sinks
Top Layer (User Interface):
[Logging Macros] --> [Logger Interface]
Middle Layer (Frontend):
[Logger Manager] <--> [Queue System]
[Metadata Store] --> [Type Codec]
Bottom Layer (Backend):
[Backend Worker] --> [Sink Manager]
[Format Engine] <--> [Output Sinks]
Important Relationships
a) Data Flow:
Log Call -> Metadata Creation -> Queue Insertion -> Backend Processing -> Sink Output
b) Component Interactions:
• Frontend/Backend communication via SPSC queues
• Logger/Sink management relationships
• Formatting pipeline flow
Special Features to Highlight
a) Performance Features:
• Lock-free queues
• Static metadata
• Compile-time optimizations
• RDTSC clock support
b) Architectural Features:
• Asynchronous processing
• Multiple sink support
• Custom formatter support
• Signal handler integration
Implementation Details
Following critical paths:
Hot Path:
[LOG_Macro] -> [Static Metadata] -> [SPSC Queue] -> [Backend Worker]
Sink Path:
[Backend Worker] -> [Formatter] -> [Multiple Sinks]
Configuration Path:
[Frontend Config] -> [Logger Manager] -> [Sink Manager]
Additional Notes
• Timing indicators for critical paths
• Queue boundaries and buffer limits
• Thread boundaries clearly
• Compile-time vs. runtime components
• Ultra-low latency design
• Asynchronous processing
• Type-safe interface
• Flexible sink system
Remember to maintain a balance between detail and clarity, focusing on the architectural elements that contribute to Quill's performance and flexibility.
This design accurately represents Quill's architecture while highlighting its unique features and performance characteristics.