Skip to content

Commit

Permalink
added some trace
Browse files Browse the repository at this point in the history
  • Loading branch information
samdeane committed May 22, 2023
1 parent 5090d0c commit 4579a33
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
11 changes: 1 addition & 10 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let package = Package(
name: "Logger",

platforms: [
.macOS(.v10_13), .iOS(.v13), .tvOS(.v13), .watchOS(.v5)
.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v5)
],

products: [
Expand All @@ -16,9 +16,6 @@ let package = Package(
.library(
name: "LoggerUI",
targets: ["LoggerUI"]),
.library(
name: "LoggerKit",
targets: ["LoggerKit"]),
.library(
name: "LoggerTestSupport",
targets: ["LoggerTestSupport"])
Expand All @@ -34,9 +31,6 @@ let package = Package(
.target(
name: "Logger",
dependencies: []),
.target(
name: "LoggerKit",
dependencies: ["Logger"]),
.target(
name: "LoggerUI",
dependencies: ["Logger"]),
Expand All @@ -46,9 +40,6 @@ let package = Package(
.testTarget(
name: "LoggerTests",
dependencies: ["Logger", "LoggerTestSupport"]),
.testTarget(
name: "LoggerKitTests",
dependencies: ["LoggerKit", "LoggerTestSupport"])
]
)

Expand Down
14 changes: 12 additions & 2 deletions Sources/LoggerUI/LoggerChannelsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import SwiftUI
}

public var body: some View {
Self._printChanges()
trace()

let channels = manager.registeredChannels.sorted(by: { $0.name < $1.name })

return List {
Expand All @@ -42,7 +43,8 @@ import SwiftUI
}

public var body: some View {
Self._printChanges()
trace()

return Section(header: Text("Channels")) {
ForEach(channels, id: \Channel.name) { channel in
ChannelToggleView(channel: channel)
Expand All @@ -60,3 +62,11 @@ struct ChannelToggleView: View {
}

#endif

extension View {
func trace() {
if #available(macOS 12.0, iOS 15.0, *) {
Self._printChanges()
}
}
}

0 comments on commit 4579a33

Please sign in to comment.