general: improvements

This commit is contained in:
Michael Freno
2026-01-15 14:48:27 -05:00
parent 1b9cbf5f99
commit ec5ac6ed3d
2 changed files with 34 additions and 5 deletions

View File

@@ -2,7 +2,7 @@
// LoggingManager.swift
// Gaze
//
// Created by [Your Name] on [Date].
// Created by Mike Freno on 1/15/26.
//
import Foundation
@@ -86,3 +86,33 @@ final class LoggingManager {
}
}
// MARK: - Global Convenience Functions
/// Log an info message using the shared LoggingManager
public func logInfo(_ message: String, category: String = "General") {
LoggingManager.shared.info(message, category: category)
}
/// Log a debug message using the shared LoggingManager
public func logDebug(_ message: String, category: String = "General") {
LoggingManager.shared.debug(message, category: category)
}
/// Log an error message using the shared LoggingManager
public func logError(_ message: String, category: String = "General") {
LoggingManager.shared.error(message, category: category)
}
/// Log a warning message using the shared LoggingManager
public func logWarning(_ message: String, category: String = "General") {
LoggingManager.shared.warning(message, category: category)
}
// MARK: - Additional Helper Functions
/// Log a verbose message (only enabled in DEBUG builds)
public func logVerbose(_ message: String, category: String = "General") {
#if DEBUG
LoggingManager.shared.debug(message, category: category)
#endif
}

View File

@@ -9,7 +9,6 @@ import AppKit
import Combine
import CoreGraphics
import Foundation
import os.log
public enum ScreenCaptureAuthorizationStatus: Equatable {
case authorized
@@ -72,7 +71,7 @@ final class ScreenCapturePermissionManager: ObservableObject, ScreenCapturePermi
}
func openSystemSettings() {
LoggingManager.shared.uiLogger.log("sup")
logWarning("sup")
// Try different variations
let possibleUrls = [
"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenRecording",