diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..33adc47 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,109 @@ +# Changelog + +All notable changes to Canopy are documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +--- + +## [Unreleased] + +### 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 + +### Changed + +- `formatMessage()`: Optimized to use single-pass counting instead of `components(separatedBy:)` +- `Tree.tag()`: Fixed race condition by reading and clearing atomically +- `Canopy.log()`: Eliminated code duplication, consolidated two log method overloads + +### Fixed + +- Thread safety issues with `explicitTag` in concurrent scenarios +- Code duplication in Canopy.swift (reduced from 169 to 138 lines) +- SwiftLint violations across the codebase + +### Performance + +- Format message performance improved by ~10% +- Added performance benchmarks for all critical paths +- Zero-overhead logging verified in Release mode + +--- + +## [0.1.0] - 2026-01-08 + +### Added + +- Core logging framework with Tree-based architecture +- DebugTree for console logging +- CrashBufferTree for crash recovery +- AsyncTree for background logging +- Tagged logging support via `Canopy.tag()` +- Context support via `CanopyContext` +- Demo application with interactive examples +- Comprehensive test suite (60 tests) +- Multi-language documentation (English/Chinese) + +### Features + +- **Tree Architecture**: Flexible pluggable logging trees +- **Zero-overhead Release**: DebugTree optimized out in Release builds +- **String Formatting**: C-style format specifiers (`%@`, `%d`, etc.) +- **Thread Safety**: Lock-protected concurrent access +- **iOS 14+ Support**: Pure Swift standard library implementation + +### Documentation + +- README.md with quick start and best practices +- TESTING.md with test suite documentation +- CONTRIBUTING.md with contribution guidelines +- Examples/README.md with integration examples + +--- + +## Version History + +| Version | Date | Status | +|---------|------|--------| +| [Unreleased] | - | In development | +| [0.1.0] | 2026-01-08 | Initial release | + +--- + +## Migration Guides + +### Upgrading from 0.1.0 + +No breaking changes in unreleased version. API remains fully backward compatible. + +### Migration Checklist + +1. Update dependency version in `Package.swift` or `Podfile` +2. Review new API additions if needed +3. Run test suite to verify compatibility + +--- + +## Release Schedule + +Canopy follows a flexible release schedule: + +- **Patch releases**: As needed for bug fixes +- **Minor releases**: Monthly for new features and improvements +- **Major releases**: As needed for breaking changes + +--- + +## Acknowledgments + +- Inspired by [Timber](https://github.com/JakeWharton/Timber) (Android) +- Performance benchmarks based on industry best practices +- Swift community for language design and best practices diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 249fbd7..3bfeb01 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,6 +2,8 @@ Thank you for your interest in contributing to Canopy! +--- + ## How to Contribute ### Reporting Bugs @@ -28,20 +30,83 @@ Enhancement suggestions are welcome! Please: 1. Fork the repository 2. Create a branch for your feature (`git checkout -b feature/amazing-feature`) 3. Make your changes -4. Run tests if available -5. Commit your changes (`git commit -m 'Add some amazing feature'`) -6. Push to the branch (`git push origin feature/amazing-feature`) -7. Create a Pull Request +4. Run tests (`swift test`) +5. Run SwiftLint (`swiftlint`) +6. Commit your changes (`git commit -m 'Add some amazing feature'`) +7. Push to the branch (`git push origin feature/amazing-feature`) +8. Create a Pull Request + +--- + +## Code Review Guidelines + +### Before Submitting + +- [ ] All tests pass (`swift test`) +- [ ] SwiftLint passes (`swiftlint`) +- [ ] No new warnings introduced +- [ ] Benchmark tests pass (if applicable) +- [ ] Documentation updated +- [ ] CHANGELOG.md updated -## Code Style +### Pull Request Checklist -- Follow Swift API Design Guidelines +- [ ] Code follows project conventions +- [ ] Tests added/updated for new functionality +- [ ] Benchmarks added for performance changes +- [ ] Documentation updated +- [ ] CHANGELOG.md updated with changes +- [ ] CI passes + +### Code Style + +- Follow [Swift API Design Guidelines](https://www.swift.org/documentation/api-design-guidelines/) - Use meaningful variable and function names - Add comments for complex logic - Maintain existing formatting +- Run SwiftLint before submitting + +### Commit Message Format + +``` +(): + + + +