From d6a11b221272744c71d2d89a710740d77e8cc617 Mon Sep 17 00:00:00 2001 From: syxc Date: Mon, 12 Jan 2026 05:26:54 +0800 Subject: [PATCH 1/7] Add public initializer to Tree class Missing public init() in Tree class prevents external module usage --- Canopy/Sources/Tree.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Canopy/Sources/Tree.swift b/Canopy/Sources/Tree.swift index 276887c..92abe64 100644 --- a/Canopy/Sources/Tree.swift +++ b/Canopy/Sources/Tree.swift @@ -19,6 +19,8 @@ open class Tree: @unchecked Sendable { /// Marked as nonisolated(unsafe) because subclasses use locks for thread safety. nonisolated(unsafe) open var minLevel: LogLevel = .verbose + public init() {} + @discardableResult nonisolated open func tag(_ tag: String?) -> Self { self.explicitTag = (tag?.isEmpty ?? true) ? nil : tag From b2d4ec707a4ebb6e64a9bf721ac6fd009b6ebfef Mon Sep 17 00:00:00 2001 From: nian1 Date: Mon, 12 Jan 2026 05:35:32 +0800 Subject: [PATCH 2/7] fix: make DebugTree initializer public for external modules Added explicit public init() to DebugTree to resolve compilation error when used in external modules. Updated version to 0.2.2 in all relevant files. --- CHANGELOG.md | 15 ++++++++++++++- CONTRIBUTING.md | 6 +++--- Canopy.podspec | 2 +- Canopy/Sources/DebugTree.swift | 4 ++++ README.md | 4 ++-- README.zh-CN.md | 4 ++-- 6 files changed, 26 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd40228..6f02a3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --- +## [0.2.2] - 2026-01-12 + +### Fixed + +- **DebugTree accessibility**: Added explicit `public init()` to DebugTree to resolve compilation error when using DebugTree in external modules ("DebugTree initializer is inaccessible due to 'internal' protection level") + +### BREAKING CHANGES + +- **None** - This release is fully backward compatible with 0.2.1 + +--- + ## [0.2.1] - 2026-01-12 ### Changed @@ -117,7 +129,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | Version | Date | Status | |---------|------|--------| -| [0.2.1] | 2026-01-12 | **Current Release** - Update source URL to HTTPS | +| [0.2.2] | 2026-01-12 | **Current Release** - Fix DebugTree accessibility | +| [0.2.1] | 2026-01-12 | Update source URL to HTTPS | | [0.2.0] | 2026-01-09 | Stability & Security Improvements | | [0.1.0] | 2026-01-08 | Initial release | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 59c4763..064fdec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -185,8 +185,8 @@ All tests must pass before merging. 1. Update version in `Package.swift` 2. Update CHANGELOG.md with new version -3. Create git tag (`git tag v0.2.1`) -4. Push tag (`git push origin v0.2.1`) +3. Create git tag (`git tag v0.2.2`) +4. Push tag (`git push origin v0.2.2`) ### Release Checklist @@ -201,7 +201,7 @@ All tests must pass before merging. ### Release Notes Format ```markdown -## v0.2.1 +## v0.2.2 ### New Features - Feature description diff --git a/Canopy.podspec b/Canopy.podspec index 601f868..0eb6e84 100644 --- a/Canopy.podspec +++ b/Canopy.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Canopy' - s.version = '0.2.1' + s.version = '0.2.2' s.summary = 'A lightweight, high-performance logging framework for iOS' s.description = <<-DESC Canopy is a logging framework inspired by Android's Timber, using a Tree-based architecture. diff --git a/Canopy/Sources/DebugTree.swift b/Canopy/Sources/DebugTree.swift index 065fb4a..1be73dc 100644 --- a/Canopy/Sources/DebugTree.swift +++ b/Canopy/Sources/DebugTree.swift @@ -15,6 +15,10 @@ import os.log /// Uses os.log on supported platforms, falls back to NSLog. open class DebugTree: Tree, @unchecked Sendable { + public init() { + super.init() + } + nonisolated public override func log( priority: LogLevel, tag: String?, diff --git a/README.md b/README.md index 9481ef6..7744302 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,11 @@ Add Canopy to your project using Swift Package Manager or CocoaPods: ```bash # Swift Package Manager dependencies: [ - .package(url: "https://github.com/ding1dingx/Canopy.git", from: "0.2.1") + .package(url: "https://github.com/ding1dingx/Canopy.git", from: "0.2.2") ] # CocoaPods -pod 'Canopy', '~> 0.2.1' +pod 'Canopy', '~> 0.2.2' ``` Initialize in your `AppDelegate`: diff --git a/README.zh-CN.md b/README.zh-CN.md index 526134f..dc47aac 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -20,11 +20,11 @@ ```bash # Swift Package Manager dependencies: [ - .package(url: "https://github.com/ding1dingx/Canopy.git", from: "0.2.1") + .package(url: "https://github.com/ding1dingx/Canopy.git", from: "0.2.2") ] # CocoaPods -pod 'Canopy', '~> 0.2.1' +pod 'Canopy', '~> 0.2.2' ``` 在 `AppDelegate` 中初始化: From ae143646167c1cb080cc51664db3bb210327313e Mon Sep 17 00:00:00 2001 From: nian1 Date: Mon, 12 Jan 2026 05:35:45 +0800 Subject: [PATCH 3/7] Release 0.2.2 From e3f83627a63f83be35918762b8c92f309d6f73fc Mon Sep 17 00:00:00 2001 From: nian1 Date: Mon, 12 Jan 2026 05:40:03 +0800 Subject: [PATCH 4/7] refactor: Make DebugTree init override explicit --- Canopy/Sources/DebugTree.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Canopy/Sources/DebugTree.swift b/Canopy/Sources/DebugTree.swift index 1be73dc..4e79a66 100644 --- a/Canopy/Sources/DebugTree.swift +++ b/Canopy/Sources/DebugTree.swift @@ -15,7 +15,7 @@ import os.log /// Uses os.log on supported platforms, falls back to NSLog. open class DebugTree: Tree, @unchecked Sendable { - public init() { + public override init() { super.init() } From 6bb0b75e58a2c0885468b5d46f0600118a95ae39 Mon Sep 17 00:00:00 2001 From: nian1 Date: Mon, 12 Jan 2026 05:40:10 +0800 Subject: [PATCH 5/7] Release 0.2.2 From 5c862f74b6f571d4e07d8ba9e3b8c4d0aa94ddd3 Mon Sep 17 00:00:00 2001 From: nian1 Date: Mon, 12 Jan 2026 05:45:09 +0800 Subject: [PATCH 6/7] refactor: remove redundant DebugTree initializer --- Canopy/Sources/DebugTree.swift | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Canopy/Sources/DebugTree.swift b/Canopy/Sources/DebugTree.swift index 4e79a66..065fb4a 100644 --- a/Canopy/Sources/DebugTree.swift +++ b/Canopy/Sources/DebugTree.swift @@ -15,10 +15,6 @@ import os.log /// Uses os.log on supported platforms, falls back to NSLog. open class DebugTree: Tree, @unchecked Sendable { - public override init() { - super.init() - } - nonisolated public override func log( priority: LogLevel, tag: String?, From f68ea72cbf7c599824bfc96e462b8171314f2ab8 Mon Sep 17 00:00:00 2001 From: nian1 Date: Mon, 12 Jan 2026 05:45:30 +0800 Subject: [PATCH 7/7] Release 0.2.2