How hyeongryong/jdlogger works
Main Components
a. Core Layer:
• ILogFormatter interface
• ILogModel interface
• ILoggerScope interface
• Core models (LogEntity, ExceptionInfo)
b. Formatting Layer:
• JDLoggerFormatter (main formatter)
• Different formatter implementations (CSV, JSON, TabDelimited)
• LogDataPreparer
• Attributes system (ExportIgnore)
c. Persistence Layer:
• A "Persistence" component containing:
• Logger extensions
• Mapper implementations
• Scope implementations (JDLoggerAdapter, JDLoggerScope)
d. SQLite Storage:
• Database component as the underlying storage system
Relationships and Data Flow
• Client Application → JDLogger (entry point)
• JDLogger → LoggerScope (scope creation)
• LoggerScope → Formatters (data formatting)
• LoggerScope → Persistence Layer (data storage)
• Persistence Layer → SQLite Storage (final storage)
Detailed Elements
a. Entry Points:
• Initialize() method
• BeginScope<T>() method
b. Core Operations:
• Logging flow
• Query capabilities
• Export operations
• Exception handling
c. Extension Points:
• Custom formatters
• Custom log models
• Log handlers
Implementation Notes
• Different log levels
• Scope inheritance
• Data flow directions
• Threading model
• Extension points
Architecture Patterns
Following patterns:
• Repository pattern for data access
• Strategy pattern for formatting
• Observer pattern for log handlers
• Chain of responsibility for scope hierarchy
Storage Layer
Remember to include notes about:
• Thread-safety mechanisms
• Scope hierarchy handling
• Custom model support
• Export functionality
• Exception handling flow
This structure will provide a clear visualization of how JDLogger works as a lightweight, yet feature-rich logging solution while maintaining its architectural integrity and extensibility points.