From b81670f3f439eff8df615257ff70d9ef39e60065 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 01 Jun 2026 17:02:53 +0000 Subject: [PATCH] macOS: mark Swift os.Logger interpolations as public (#12877) ### AI Disclosure Claude implemented it. I'm fully aware of and confident about the change; it's just chore work actually. --- macos/Sources/Ghostty/Ghostty.App.swift | 22 +++++++++++----------- macos/Sources/Ghostty/Ghostty.Config.swift | 4 ++-- macos/Sources/App/macOS/AppDelegate.swift | 4 ++-- macos/Sources/Features/Global Keybinds/GlobalEventTap.swift | 2 +- macos/Sources/Features/Secure Input/SecureInput.swift | 8 ++++---- macos/Sources/Features/Terminal/BaseTerminalController.swift | 10 +++++----- macos/Sources/Features/Terminal/TerminalRestorable.swift | 2 +- macos/Sources/Ghostty/Surface View/OSSurfaceView.swift | 4 ++-- macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift | 26 +++++++++++++------------- macos/Sources/Helpers/Extensions/NSWindow+Extension.swift | 2 +- 10 file(s) changed, 42 insertion(s)(+), 42 deletion(s)(-) diff --git a/macos/Sources/Ghostty/Ghostty.App.swift b/macos/Sources/Ghostty/Ghostty.App.swift --- a/macos/Sources/Ghostty/Ghostty.App.swift +++ b/macos/Sources/Ghostty/Ghostty.App.swift @@ -190,14 +190,14 @@ func newTab(surface: ghostty_surface_t) { let action = "new_tab" if !ghostty_surface_binding_action(surface, action, UInt(action.lengthOfBytes(using: .utf8))) { - logger.warning("action failed action=\(action)") + logger.warning("action failed action=\(action, privacy: .public)") } } func newWindow(surface: ghostty_surface_t) { let action = "new_window" if !ghostty_surface_binding_action(surface, action, UInt(action.lengthOfBytes(using: .utf8))) { - logger.warning("action failed action=\(action)") + logger.warning("action failed action=\(action, privacy: .public)") } } @@ -220,14 +220,14 @@ func splitToggleZoom(surface: ghostty_surface_t) { let action = "toggle_split_zoom" if !ghostty_surface_binding_action(surface, action, UInt(action.lengthOfBytes(using: .utf8))) { - logger.warning("action failed action=\(action)") + logger.warning("action failed action=\(action, privacy: .public)") } } func toggleFullscreen(surface: ghostty_surface_t) { let action = "toggle_fullscreen" if !ghostty_surface_binding_action(surface, action, UInt(action.lengthOfBytes(using: .utf8))) { - logger.warning("action failed action=\(action)") + logger.warning("action failed action=\(action, privacy: .public)") } } @@ -248,21 +248,21 @@ action = "reset_font_size" } if !ghostty_surface_binding_action(surface, action, UInt(action.lengthOfBytes(using: .utf8))) { - logger.warning("action failed action=\(action)") + logger.warning("action failed action=\(action, privacy: .public)") } } func toggleTerminalInspector(surface: ghostty_surface_t) { let action = "inspector:toggle" if !ghostty_surface_binding_action(surface, action, UInt(action.lengthOfBytes(using: .utf8))) { - logger.warning("action failed action=\(action)") + logger.warning("action failed action=\(action, privacy: .public)") } } func resetTerminal(surface: ghostty_surface_t) { let action = "reset" if !ghostty_surface_binding_action(surface, action, UInt(action.lengthOfBytes(using: .utf8))) { - logger.warning("action failed action=\(action)") + logger.warning("action failed action=\(action, privacy: .public)") } } @@ -485,7 +485,7 @@ break default: - Ghostty.logger.warning("unknown action target=\(target.tag.rawValue)") + Ghostty.logger.warning("unknown action target=\(target.tag.rawValue, privacy: .public)") return false } @@ -672,7 +672,7 @@ case GHOSTTY_ACTION_COPY_TITLE_TO_CLIPBOARD: return copyTitleToClipboard(app, target: target) default: - Ghostty.logger.warning("unknown action action=\(action.tag.rawValue)") + Ghostty.logger.warning("unknown action action=\(action.tag.rawValue, privacy: .public)") return false } @@ -979,7 +979,7 @@ guard let surface = target.target.surface else { return } guard let surfaceView = self.surfaceView(from: surface) else { return } guard let mode = FullscreenMode.from(ghostty: raw) else { - Ghostty.logger.warning("unknown fullscreen mode raw=\(raw.rawValue)") + Ghostty.logger.warning("unknown fullscreen mode raw=\(raw.rawValue, privacy: .public)") return } NotificationCenter.default.post( @@ -1399,7 +1399,7 @@ let center = UNUserNotificationCenter.current() center.requestAuthorization(options: [.alert, .sound]) { _, error in if let error = error { - Ghostty.logger.error("Error while requesting notification authorization: \(error)") + Ghostty.logger.error("Error while requesting notification authorization: \(error, privacy: .public)") } } diff --git a/macos/Sources/Ghostty/Ghostty.Config.swift b/macos/Sources/Ghostty/Ghostty.Config.swift --- a/macos/Sources/Ghostty/Ghostty.Config.swift +++ b/macos/Sources/Ghostty/Ghostty.Config.swift @@ -95,13 +95,13 @@ // pop-up window too. let diagsCount = ghostty_config_diagnostics_count(cfg) if diagsCount > 0 { - logger.warning("config error: \(diagsCount) configuration errors on reload") + logger.warning("config error: \(diagsCount, privacy: .public) configuration errors on reload") var diags: [String] = [] for i in 0..