From 6a5528f6c68f692588747302158a45ea9c740068 Mon Sep 17 00:00:00 2001 From: ZachNagengast Date: Wed, 6 Nov 2024 14:08:57 -0800 Subject: [PATCH 1/2] Use @frozen for loglevel enum --- Sources/WhisperKit/Core/Utils.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/WhisperKit/Core/Utils.swift b/Sources/WhisperKit/Core/Utils.swift index c9e9a54..c9455b6 100644 --- a/Sources/WhisperKit/Core/Utils.swift +++ b/Sources/WhisperKit/Core/Utils.swift @@ -771,6 +771,7 @@ public class Logging { private let logger = OSLog(subsystem: Bundle.main.bundleIdentifier ?? "com.argmax.whisperkit", category: "WhisperKit") + @frozen public enum LogLevel: Int { case debug = 1 case info = 2 From 5bac36c89f3bf662cb9b899b5ccf4dd0e5019fb6 Mon Sep 17 00:00:00 2001 From: ZachNagengast Date: Wed, 6 Nov 2024 16:41:10 -0800 Subject: [PATCH 2/2] Add public accessibility for loggingcallback and loglevel --- Sources/WhisperKit/Core/Utils.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/WhisperKit/Core/Utils.swift b/Sources/WhisperKit/Core/Utils.swift index c9455b6..77824e4 100644 --- a/Sources/WhisperKit/Core/Utils.swift +++ b/Sources/WhisperKit/Core/Utils.swift @@ -762,12 +762,12 @@ public func getMemoryUsage() -> UInt64 { // MARK: - Singletons -public class Logging { - static let shared = Logging() - var logLevel: LogLevel = .none +open class Logging { + public static let shared = Logging() + public var logLevel: LogLevel = .none public typealias LoggingCallback = (_ message: String) -> Void - var loggingCallback: LoggingCallback? + public var loggingCallback: LoggingCallback? private let logger = OSLog(subsystem: Bundle.main.bundleIdentifier ?? "com.argmax.whisperkit", category: "WhisperKit")