Repository navigation
v1.1.0 - [Stable version] Comprehensive Testing, Documentation & Quality Enhancement (2026-01-16)
Added
-
All config chain methods (WithLevel, WithFormat, WithDynamicCaller, filtering methods)
-
All logger instance methods (Print, Println, Printf, Text, Textf, Json, Jsonf)
-
Enhanced fmt package functions (NewErrorWith, PrintfWith, PrintlnWith)
-
Security filter control (Enable/Disable/IsEnabled)
-
Complex type formatting (slices, maps, nested structures)
-
File rotation and compression triggers
-
JSON options customization
-
Dynamic caller detection
-
Edge cases and error handling
-
Log Level Alignment: Improved visual organization of text log output
- Fixed-width padding for log levels (DEBUG, INFO, WARN, ERROR, FATAL)
- Consistent spacing between timestamp and level
- Cleaner, more organized log appearance
- Easier log scanning and parsing
-
Logger Instance fmt Methods: Print(), Println(), Printf() on logger instances
- Consistent with package-level functions
- All include caller information
- Full feature parity between instance and package-level APIs
Changed
-
API Consistency: Print() now an alias for Println() (both add spaces and newlines)
- Simplifies API by eliminating confusion
- Prioritizes developer convenience over strict fmt compatibility
- Better matches common usage patterns
-
Enhanced fmt Package: All fmt replacement methods now include caller information
- Printf() at both package and instance level
- Consistent debugging experience across all console output
- Better traceability for all output methods
-
Logger Instance Methods: Text/Json/Textf/Jsonf now output directly to stdout
- Consistent behavior with package-level functions
- Include caller information
- Unified debugging experience
-
Log Output Format: Timestamp and level wrapped in brackets
[2026-01-16T17:40:46+08:00 INFO]format- Better visual separation of metadata and message
- Easier parsing and log analysis
Fixed
-
Documentation Accuracy: Comprehensive README.md verification and corrections
- Added missing API entries (Json, Jsonf, Text, Textf, Exit, Exitf)
- Updated structured logging example with proper field types
-
Code Quality: Comprehensive optimization and refactoring
- Removed over-engineering and redundant code (~100 lines eliminated)
- Fixed TOCTOU vulnerability in symlink validation
- Fixed resource leaks in compression (proper defer usage)
- Added ReDoS protection (regex complexity validation)
- Improved error handling in SetLevel()
- Consolidated duplicate security patterns
-
Performance: Optimizations while maintaining all functionality
- Lock-free Default() initialization
- Better string building with strings.Builder
- Simplified TypeConverter (removed pool overhead)
- Direct pattern application for security filters
-
Security: Critical vulnerability fixes
- TOCTOU attack prevention in file operations
- ReDoS attack prevention with pattern validation
- Resource leak elimination in compression
- Better symlink validation
Removed
- Redundant Code: ~65 lines of unused helper functions
- Excessive Comments: Cleaned up obvious/redundant comments
- Duplicate Implementations: Consolidated pattern definitions
Improved
-
Code Organization: Better separation of concerns
- Validation separated from default value application
- Simplified backup path building logic
-
Maintainability: Centralized pattern registry
- Single source of truth for security patterns
- Easier to add/modify patterns
- Better DRY principle adherence
Performance Impact
- Test Coverage: 77% (+10%)
- Code Quality: Significantly improved with comprehensive test suite
- Backward Compatibility: 100% maintained (except Print() behavior change)
- Documentation: 100% accurate (verified against implementation)