Skip to content

Commit 5254d82

Browse files
Freeze loglevel enum (#255)
* Use @Frozen for loglevel enum * Add public accessibility for loggingcallback and loglevel
1 parent 03f0bb4 commit 5254d82

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Sources/WhisperKit/Core/Utils.swift

+5-4
Original file line numberDiff line numberDiff line change
@@ -762,15 +762,16 @@ public func getMemoryUsage() -> UInt64 {
762762

763763
// MARK: - Singletons
764764

765-
public class Logging {
766-
static let shared = Logging()
767-
var logLevel: LogLevel = .none
765+
open class Logging {
766+
public static let shared = Logging()
767+
public var logLevel: LogLevel = .none
768768

769769
public typealias LoggingCallback = (_ message: String) -> Void
770-
var loggingCallback: LoggingCallback?
770+
public var loggingCallback: LoggingCallback?
771771

772772
private let logger = OSLog(subsystem: Bundle.main.bundleIdentifier ?? "com.argmax.whisperkit", category: "WhisperKit")
773773

774+
@frozen
774775
public enum LogLevel: Int {
775776
case debug = 1
776777
case info = 2

0 commit comments

Comments
 (0)