Skip to content

Commit

Permalink
Add swift-log dependency to kdbxswift package metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyrat committed Nov 21, 2023
1 parent 2186691 commit 023c6c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion ios/KdbxSwift/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ let package = Package(
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.3"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "KdbxSwift",
dependencies: []),
dependencies: [
.product(name: "Logging", package: "swift-log")]),
.testTarget(
name: "KdbxSwiftTests",
dependencies: ["KdbxSwift"]),
Expand Down
8 changes: 4 additions & 4 deletions ios/KdbxSwift/Sources/KdbxSwift/util/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import Logging
extension Logger {
private static var subsystem = Bundle.main.bundleIdentifier!

public static var mainLog = Logging.Logger(label: "com.keevault.kdbxswift")
public static var appLog = Logging.Logger(label: "com.keevault.keevault")
public static var mainLog = Logger(label: "com.keevault.kdbxswift")
public static var appLog = Logger(label: "com.keevault.keevault")

public static func fatalError(_ message:String) -> Never {
//TODO: stack trace, metadata, etc.?
Expand All @@ -14,8 +14,8 @@ extension Logger {
}

public static func reloadConfig() {
mainLog = Logging.Logger(label: "com.keevault.kdbxswift")
appLog = Logging.Logger(label: "com.keevault.keevault")
mainLog = Logger(label: "com.keevault.kdbxswift")
appLog = Logger(label: "com.keevault.keevault")
mainLog.info("Log configuration refreshed")
}
}
Expand Down

0 comments on commit 023c6c3

Please sign in to comment.