Skip to content

Commit

Permalink
fixing felinepine logging
Browse files Browse the repository at this point in the history
  • Loading branch information
leogdion committed Oct 21, 2024
1 parent 764701c commit bb77d17
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 72 deletions.
19 changes: 10 additions & 9 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,23 @@ import PackageDescription
let package = Package(
name: "FelinePineLogging",
platforms: [.iOS(.v14), .watchOS(.v7), .macOS(.v11)],
dependencies: [
.package(path: "Packages/FelinePine"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0")
],
products: [
.library(
name: "FelinePineLogging",
targets: ["FelinePineLogging"]
)
],
dependencies: [
.package(path: "Packages/FelinePine"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0")
],
targets: [
.target(
name: "FelinePineLogging",
dependencies: [
"FelinePine",
.product(name: "Logging", package: "swift-log")
],
swiftSettings: [
SwiftSetting.enableUpcomingFeature("BareSlashRegexLiterals"),
SwiftSetting.enableUpcomingFeature("ConciseMagicFile"),
Expand All @@ -27,11 +31,8 @@ let package = Package(
SwiftSetting.enableUpcomingFeature("ImplicitOpenExistentials"),
SwiftSetting.enableUpcomingFeature("StrictConcurrency"),
SwiftSetting.enableUpcomingFeature("DisableOutwardActorInference"),
SwiftSetting.enableExperimentalFeature("StrictConcurrency")
],
dependencies: [
"FelinePine",
.product(name: "Logging", package: "swift-log")
SwiftSetting.enableExperimentalFeature("StrictConcurrency"),
SwiftSetting.enableExperimentalFeature("AccessLevelOnImport")
]
),
.testTarget(
Expand Down
2 changes: 1 addition & 1 deletion Sources/FelinePineLogging/Feline.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
//

public import FelinePine
import Foundation
internal import Foundation
public import Logging

extension Feline where Self: Pine, Self.LoggingSystemType.Category: CaseIterable {
Expand Down
53 changes: 41 additions & 12 deletions Sources/FelinePineLogging/Loggable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,44 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
import Logging

// #if canImport(os)
// public typealias FelinePineProtocol = Feline & Pine
// #else
// public typealias FelinePineProtocol = Feline
// #endif
//
///// Loggable type for a ``LoggingSystem``.
// public protocol Loggable<LoggingSystemType>: FelinePineProtocol
// where LoggingSystemType: LoggingSystem {}
////
//// Loggable.swift
//// FelinePine
////
//// Created by Leo Dion.
//// Copyright © 2024 BrightDigit.
////
//// Permission is hereby granted, free of charge, to any person
//// obtaining a copy of this software and associated documentation
//// files (the “Software”), to deal in the Software without
//// restriction, including without limitation the rights to use,
//// copy, modify, merge, publish, distribute, sublicense, and/or
//// sell copies of the Software, and to permit persons to whom the
//// Software is furnished to do so, subject to the following
//// conditions:
////
//// The above copyright notice and this permission notice shall be
//// included in all copies or substantial portions of the Software.
////
//// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
//// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
//// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
//// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
//// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
//// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
//// OTHER DEALINGS IN THE SOFTWARE.
////
//
// import Foundation
// import Logging
//
//// #if canImport(os)
//// public typealias FelinePineProtocol = Feline & Pine
//// #else
//// public typealias FelinePineProtocol = Feline
//// #endif
////
/////// Loggable type for a ``LoggingSystem``.
//// public protocol Loggable<LoggingSystemType>: FelinePineProtocol
//// where LoggingSystemType: LoggingSystem {}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
internal import Foundation
public import protocol FelinePine.LoggingSystem
public import struct Logging.Logger

Expand Down
2 changes: 1 addition & 1 deletion Sources/FelinePineLogging/NSLocking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
internal import Foundation

#if !canImport(os)
extension NSLocking {
Expand Down
62 changes: 14 additions & 48 deletions Sources/FelinePineLogging/Pine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,51 +27,17 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

////
//// Pine.swift
//// FelinePineLogging
////
//// Created by Leo Dion.
//// Copyright © 2024 BrightDigit.
////
//// Permission is hereby granted, free of charge, to any person
//// obtaining a copy of this software and associated documentation
//// files (the “Software”), to deal in the Software without
//// restriction, including without limitation the rights to use,
//// copy, modify, merge, publish, distribute, sublicense, and/or
//// sell copies of the Software, and to permit persons to whom the
//// Software is furnished to do so, subject to the following
//// conditions:
////
//// The above copyright notice and this permission notice shall be
//// included in all copies or substantial portions of the Software.
////
//// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
//// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
//// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
//// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
//// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
//// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
//// OTHER DEALINGS IN THE SOFTWARE.
////
//
// import Foundation
//
// #if swift(<6.0)
// import Logging
// #else
// public import Logging
// #endif
//
// #if canImport(Logging)
// /// Defines a shared logger for the type.
// ///
// /// Provides a shared ``Logger`` to use in this type.
// public protocol Pine {
// /// Shared logger for Type.
// static var logger: Logger {
// get
// }
// }
// #endif
public import Foundation
public import Logging

#if !canImport(os)
/// Defines a shared logger for the type.
///
/// Provides a shared ``Logger`` to use in this type.
public protocol Pine {
/// Shared logger for Type.
static var logger: Logger {
get
}
}
#endif

0 comments on commit bb77d17

Please sign in to comment.