Skip to content

Commit

Permalink
Update format.
Browse files Browse the repository at this point in the history
  • Loading branch information
rismay committed Jul 23, 2024
1 parent 86b4d77 commit 05e92d6
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 18 deletions.
21 changes: 20 additions & 1 deletion Package.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
{
"originHash" : "35a1e544686ac5138e91cd674604255c1c9d20deb6589cbc878ab55dbdc0dfe2",
"pins" : [
{
"identity" : "swift-docc-plugin",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-docc-plugin",
"state" : {
"revision" : "26ac5758409154cc448d7ab82389c520fa8a8247",
"version" : "1.3.0"
}
},
{
"identity" : "swift-docc-symbolkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-docc-symbolkit",
"state" : {
"revision" : "b45d1f2ed151d057b54504d653e0da5552844e34",
"version" : "1.0.0"
}
},
{
"identity" : "swift-log",
"kind" : "remoteSourceControl",
Expand All @@ -10,5 +29,5 @@
}
}
],
"version" : 2
"version" : 3
}
12 changes: 6 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// swift-tools-version:5.10
import Foundation
import PackageDescription

// MARK: - Package Declaration
Expand All @@ -14,7 +15,7 @@ let package = Package(
.watchOS(.v9),
],
products: [
.library(name: "WrkstrmLog", targets: ["WrkstrmLog"]),
.library(name: "WrkstrmLog", targets: ["WrkstrmLog"])
],
dependencies: [
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.1.0"),
Expand All @@ -24,12 +25,11 @@ let package = Package(
.target(
name: "WrkstrmLog",
dependencies: [.product(name: "Logging", package: "swift-log")],
swiftSettings: Package.Inject.shared.swiftSettings),
swiftSettings: Package.Inject.shared.swiftSettings
),
.testTarget(name: "WrkstrmLogTests", dependencies: ["WrkstrmLog"]),
])

// PACKAGE_SERVICE_START_V0_0_1_HASH:f2c9eab644cc6416b9f6608bf581ad8c0b4c606c2c2dac5e62505e70cc7bfc53
import Foundation
]
)

// MARK: - Package Service

Expand Down
12 changes: 8 additions & 4 deletions Sources/WrkstrmLog/Log+Shared.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ extension Log {
function: function,
line: line,
column: column,
dso: dso)
dso: dso
)
}

/// Logs a info message with the specified parameters.
Expand All @@ -63,7 +64,8 @@ extension Log {
function: function,
line: line,
column: column,
dso: dso)
dso: dso
)
}

/// Logs an error message with the specified parameters.
Expand All @@ -89,7 +91,8 @@ extension Log {
function: function,
line: line,
column: column,
dso: dso)
dso: dso
)
}

/// Logs a critical message and triggers a fatal error.
Expand All @@ -116,6 +119,7 @@ extension Log {
function: function,
line: line,
column: column,
dso: dso)
dso: dso
)
}
}
21 changes: 14 additions & 7 deletions Sources/WrkstrmLog/Log.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ public struct Log: Hashable {
function: function,
line: line,
column: column,
dso: dso)
dso: dso
)
}

/// Logs a informational message with the specified parameters.
Expand All @@ -159,7 +160,8 @@ public struct Log: Hashable {
function: function,
line: line,
column: column,
dso: dso)
dso: dso
)
}

/// Logs an error message with the specified parameters.
Expand All @@ -186,7 +188,8 @@ public struct Log: Hashable {
function: function,
line: line,
column: column,
dso: dso)
dso: dso
)
}

/// Logs a critical message and triggers a fatal error.
Expand Down Expand Up @@ -214,7 +217,8 @@ public struct Log: Hashable {
function: function,
line: line,
column: column,
dso: dso)
dso: dso
)
fatalError()
}

Expand All @@ -232,7 +236,8 @@ public struct Log: Hashable {
string:
file
// swiftlint:disable:next force_unwrapping
.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!)!
.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
)!
let fileName = url.lastPathComponent.replacingOccurrences(of: ".swift", with: "")
let functionString = formattedFunction(function)
switch style {
Expand All @@ -256,7 +261,8 @@ public struct Log: Hashable {
url.lastPathComponent,
line,
functionString,
String(describing: describable))
String(describing: describable)
)
#endif // canImport(os)

case .swift:
Expand All @@ -274,7 +280,8 @@ public struct Log: Hashable {
source: url.lastPathComponent,
file: file,
function: functionString,
line: line)
line: line
)
}
}
}

0 comments on commit 05e92d6

Please sign in to comment.