Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Freeze loglevel enum #255

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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