Releases: ding1dingx/Canopy
Releases · ding1dingx/Canopy
0.2.3
Error parameter support
New Features
- Error parameter support: All log methods (v, d, i, w, e) now accept an optional Error? parameter
- Error propagation: Error objects are now correctly passed to all Tree implementations
- Enhanced error handling: Built-in Trees (DebugTree, CrashBufferTree, AsyncTree) now properly process and display error information
Bug Fixes
- Error parameter propagation: Previously, error parameter was hardcoded to nil in internal log() method
- SentryTree compatibility: Error objects are now correctly captured and can be sent to Sentry's captureException()
- CrashBufferTree error handling: Error information is now included in buffered log messages
Testing
- Added 6 new test cases to verify error parameter functionality
- Total test count increased from 96 to 102 tests
- All tests passing (100%)
Documentation
- Added "Logging with Errors" section to README (both English and Chinese)
- Updated all documentation to reflect 102 total tests
- Added Error parameter support to feature list
Compatibility
- Fully backward compatible with 0.2.2
- All existing APIs without error parameter continue to work
- New error parameter is optional with default value nil
Full Changelog: 0.2.2...0.2.3
0.2.2
0.2.1
Full Changelog: 0.2.0...0.2.1
0.2.0
[0.2.0] - 2026-01-09
Added
- Comprehensive performance benchmark suite (15 tests)
- Crash recovery integration tests (12 tests)
- GitHub Actions CI/CD workflow
- SwiftLint configuration with code quality rules
- Platform-aware lock implementation
- Documentation for testing and CI/CD
- Parameter validation: CrashBufferTree now validates
maxSize(must be > 0 and <= 10000) - Tag length validation: CanopyContext.with() now validates tag length (max 100 characters)
- Flush failure logging: CrashBufferTree now logs flush failures via NSLog
- Comprehensive test coverage: Increased from 87 to 91 tests
Changed
formatMessage(): Optimized to use single-pass counting instead ofcomponents(separatedBy:)Tree.tag(): Fixed race condition by reading and clearing atomicallyCanopy.log(): Eliminated code duplication, consolidated two log method overloads- Empty tag format: Improved readability - empty tags now display as
[priority]: messageinstead of[] message - DebugTree log level: Fixed
warninglevel mapping from.errorto.debugfor accurate OSLogType mapping
Fixed
- Signal handler safety: Removed
flush()from signal handlers to prevent deadlocks (NSLock is not async-signal-safe) - AsyncTree context recovery: Added
deferto ensure CanopyContext is restored even if log() throws - CanopyContext.with(): Added whitespace trimming and empty string handling
- Tree.tag(): Fixed logic to correctly handle empty and whitespace-only strings
- Thread safety issues with
explicitTagin concurrent scenarios - Code duplication in Canopy.swift (reduced from 169 to 138 lines)
Performance
- Format message performance improved by ~10%
- Added performance benchmarks for all critical paths
- Zero-overhead logging verified in Release mode
Security
- CrashBufferTree: Fixed potential deadlock in signal handlers by moving flush to atexit() handler
- Input validation: Added parameter validation to prevent invalid input scenarios
BREAKING CHANGES
- None - This release is fully backward compatible with 0.1.0
Full Changelog: https://github.com/ding1dingx/Canopy/commits/0.2.0