general: improvements
This commit is contained in:
@@ -2,16 +2,16 @@
|
|||||||
// LoggingManager.swift
|
// LoggingManager.swift
|
||||||
// Gaze
|
// Gaze
|
||||||
//
|
//
|
||||||
// Created by [Your Name] on [Date].
|
// Created by Mike Freno on 1/15/26.
|
||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import os.log
|
import os.log
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
let isLoggingEnabled = true
|
let isLoggingEnabled = true
|
||||||
#else
|
#else
|
||||||
let isLoggingEnabled = false
|
let isLoggingEnabled = false
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// A centralized logging manager that provides structured, subsystem-aware logging
|
/// A centralized logging manager that provides structured, subsystem-aware logging
|
||||||
@@ -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
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import AppKit
|
|||||||
import Combine
|
import Combine
|
||||||
import CoreGraphics
|
import CoreGraphics
|
||||||
import Foundation
|
import Foundation
|
||||||
import os.log
|
|
||||||
|
|
||||||
public enum ScreenCaptureAuthorizationStatus: Equatable {
|
public enum ScreenCaptureAuthorizationStatus: Equatable {
|
||||||
case authorized
|
case authorized
|
||||||
@@ -72,7 +71,7 @@ final class ScreenCapturePermissionManager: ObservableObject, ScreenCapturePermi
|
|||||||
}
|
}
|
||||||
|
|
||||||
func openSystemSettings() {
|
func openSystemSettings() {
|
||||||
LoggingManager.shared.uiLogger.log("sup")
|
logWarning("sup")
|
||||||
// Try different variations
|
// Try different variations
|
||||||
let possibleUrls = [
|
let possibleUrls = [
|
||||||
"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenRecording",
|
"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenRecording",
|
||||||
|
|||||||
Reference in New Issue
Block a user