diff --git a/Sources/FelinePine/Feline.swift b/Sources/FelinePine/Feline.swift index 5e345e8..32e12fb 100644 --- a/Sources/FelinePine/Feline.swift +++ b/Sources/FelinePine/Feline.swift @@ -32,14 +32,12 @@ import Foundation #if swift(<6.0) #if canImport(os) import os - #elseif canImport(Logging) - import Logging + #endif #else #if canImport(os) public import os - #elseif canImport(Logging) - public import Logging + #endif #endif @@ -54,7 +52,7 @@ public protocol Feline { } } -#if canImport(os) || canImport(Logging) +#if canImport(os) extension Feline where Self: Pine { /// Use the ``loggingCategory`` to define the shared logger for type. public static var logger: Logger { diff --git a/Sources/FelinePine/Loggable.swift b/Sources/FelinePine/Loggable.swift index cabe286..c04cbad 100644 --- a/Sources/FelinePine/Loggable.swift +++ b/Sources/FelinePine/Loggable.swift @@ -29,7 +29,7 @@ import Foundation -#if canImport(os) || canImport(Logging) +#if canImport(os) public typealias FelinePineProtocol = Feline & Pine #else public typealias FelinePineProtocol = Feline diff --git a/Sources/FelinePine/Logger+LoggerCategory.swift b/Sources/FelinePine/Logger+LoggerCategory.swift index dca2dac..6a99a46 100644 --- a/Sources/FelinePine/Logger+LoggerCategory.swift +++ b/Sources/FelinePine/Logger+LoggerCategory.swift @@ -30,18 +30,16 @@ #if swift(<6.0) #if canImport(os) import os - #elseif canImport(Logging) - import Logging + #endif #else #if canImport(os) public import os - #elseif canImport(Logging) - public import Logging + #endif #endif -#if canImport(os) || canImport(Logging) +#if canImport(os) extension Logger { internal init( subsystem: String, diff --git a/Sources/FelinePine/Logger.swift b/Sources/FelinePine/Logger.swift index 712109a..5b02375 100644 --- a/Sources/FelinePine/Logger.swift +++ b/Sources/FelinePine/Logger.swift @@ -31,22 +31,17 @@ #if swift(<6.0) #if canImport(os) import os - #elseif canImport(Logging) - import Logging + #endif #else #if canImport(os) public import os - #elseif canImport(Logging) - public import Logging + #endif #endif #if canImport(os) /// os.Logger public typealias Logger = os.Logger -#elseif canImport(Logging) - /// swift-log Logging.Logger - public typealias Logger = Logging.Logger #endif // swiftlint:enable file_types_order diff --git a/Sources/FelinePine/LoggingSystem+LoggingSystemRepository.swift b/Sources/FelinePine/LoggingSystem+LoggingSystemRepository.swift index b15733a..1fb788f 100644 --- a/Sources/FelinePine/LoggingSystem+LoggingSystemRepository.swift +++ b/Sources/FelinePine/LoggingSystem+LoggingSystemRepository.swift @@ -32,14 +32,12 @@ import Foundation #if swift(<6.0) #if canImport(os) import os - #elseif canImport(Logging) - import Logging + #endif #else #if canImport(os) public import os - #elseif canImport(Logging) - public import Logging + #endif #endif @@ -54,7 +52,7 @@ private class LoggingSystemRepository: @unchecked Sendable { self.items = items } - #if canImport(os) || canImport(Logging) + #if canImport(os) fileprivate func loggingSystem( for system: LoggingSystemType.Type, using value: @autoclosure () -> [LoggingSystemType.Category: Logger] @@ -94,7 +92,7 @@ extension LoggingSystem { } } -#if canImport(os) || canImport(Logging) +#if canImport(os) extension LoggingSystem where Category: CaseIterable { private static var loggers: [Category: Logger] { LoggingSystemRepository.shared.loggingSystem( diff --git a/Sources/FelinePine/LoggingSystem.swift b/Sources/FelinePine/LoggingSystem.swift index 6eafde9..74ad81a 100644 --- a/Sources/FelinePine/LoggingSystem.swift +++ b/Sources/FelinePine/LoggingSystem.swift @@ -32,14 +32,12 @@ import Foundation #if swift(<6.0) #if canImport(os) import os - #elseif canImport(Logging) - import Logging + #endif #else #if canImport(os) public import os - #elseif canImport(Logging) - public import Logging + #endif #endif @@ -54,7 +52,7 @@ public protocol LoggingSystem: Sendable { /// Subsystem to use for each ``Logger``. /// By default, this is `Bundle.main.bundleIdentifier`. static var subsystem: String { get } - #if canImport(os) || canImport(Logging) + #if canImport(os) /// Fetches the correct logger based on the category. static func logger(forCategory category: Category) -> Logger #endif diff --git a/Sources/FelinePine/Pine.swift b/Sources/FelinePine/Pine.swift index 472865d..f4c904d 100644 --- a/Sources/FelinePine/Pine.swift +++ b/Sources/FelinePine/Pine.swift @@ -32,18 +32,16 @@ import Foundation #if swift(<6.0) #if canImport(os) import os - #elseif canImport(Logging) - import Logging + #endif #else #if canImport(os) public import os - #elseif canImport(Logging) - public import Logging + #endif #endif -#if canImport(os) || canImport(Logging) +#if canImport(os) /// Defines a shared logger for the type. /// /// Provides a shared ``Logger`` to use in this type. diff --git a/Tests/FelinePineTests/FelinePineTests.swift b/Tests/FelinePineTests/FelinePineTests.swift index 425b724..db71553 100644 --- a/Tests/FelinePineTests/FelinePineTests.swift +++ b/Tests/FelinePineTests/FelinePineTests.swift @@ -32,7 +32,7 @@ import XCTest internal final class FelinePineTests: XCTestCase { internal func testLogger() throws { - #if canImport(os) || canImport(Logging) + #if canImport(os) _ = MockType.logger XCTAssert(true) #else diff --git a/Tests/FelinePineTests/LoggingSystemTests.swift b/Tests/FelinePineTests/LoggingSystemTests.swift index e89d9c1..6921964 100644 --- a/Tests/FelinePineTests/LoggingSystemTests.swift +++ b/Tests/FelinePineTests/LoggingSystemTests.swift @@ -45,7 +45,7 @@ internal final class LoggingSystemTests: XCTestCase { } internal func testLogger() throws { - #if canImport(os) || canImport(Logging) + #if canImport(os) for category in MockSystem.Category.allCases { _ = MockSystem.logger(forCategory: category) }