Skip to content

Commit

Permalink
Freeze loglevel enum (#255)
Browse files Browse the repository at this point in the history
* Use @Frozen for loglevel enum

* Add public accessibility for loggingcallback and loglevel
  • Loading branch information
ZachNagengast authored Nov 7, 2024
1 parent 03f0bb4 commit 5254d82
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Sources/WhisperKit/Core/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5254d82

Please # to comment.