From 5254d82dbb6de4326d5fbdc5f5a730a50bc1ed08 Mon Sep 17 00:00:00 2001 From: Zach Nagengast Date: Wed, 6 Nov 2024 17:05:10 -0800 Subject: [PATCH] Freeze loglevel enum (#255) * Use @frozen for loglevel enum * Add public accessibility for loggingcallback and loglevel --- Sources/WhisperKit/Core/Utils.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Sources/WhisperKit/Core/Utils.swift b/Sources/WhisperKit/Core/Utils.swift index c9e9a54..77824e4 100644 --- a/Sources/WhisperKit/Core/Utils.swift +++ b/Sources/WhisperKit/Core/Utils.swift @@ -762,15 +762,16 @@ 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") + @frozen public enum LogLevel: Int { case debug = 1 case info = 2