From fe1de116f36be40d65b5a41674fa42667daf1f04 Mon Sep 17 00:00:00 2001 From: der richter Date: Mon, 1 Apr 2024 01:30:48 +0200 Subject: [PATCH] mac/app: add some verbose logging for app startup and file handling --- osdep/mac/app_hub.swift | 7 +++++++ osdep/mac/application.swift | 1 + 2 files changed, 8 insertions(+) diff --git a/osdep/mac/app_hub.swift b/osdep/mac/app_hub.swift index aba185cb2cadc..44373b17a680c 100644 --- a/osdep/mac/app_hub.swift +++ b/osdep/mac/app_hub.swift @@ -47,6 +47,7 @@ class AppHub: NSObject { #if HAVE_MACOS_MEDIA_PLAYER remote = RemoteCommandCenter(self) #endif + log.verbose("AppHub initialised") } @objc func initMpv(_ mpv: OpaquePointer) { @@ -64,15 +65,18 @@ class AppHub: NSObject { #if HAVE_MACOS_TOUCHBAR touchBar = TouchBar(self) #endif + log.verbose("AppHub functionality initialised") } @objc func initInput(_ input: OpaquePointer?) { + log.verbose("Initialising Input") self.input.signal(input: input) } @objc func initCocoaCb() { #if HAVE_MACOS_COCOA_CB if !isApplication { return } + log.verbose("Initialising CocoaCB") DispatchQueue.main.sync { self.cocoaCb = self.cocoaCb ?? CocoaCB(mpv_create_client(mpv, "cocoacb")) } @@ -81,12 +85,14 @@ class AppHub: NSObject { @objc func startRemote() { #if HAVE_MACOS_MEDIA_PLAYER + log.verbose("Starting RemoteCommandCenter") remote?.start() #endif } @objc func stopRemote() { #if HAVE_MACOS_MEDIA_PLAYER + log.verbose("Stoping RemoteCommandCenter") remote?.stop() #endif } @@ -100,6 +106,7 @@ class AppHub: NSObject { }.sorted { (strL: String, strR: String) -> Bool in return strL.localizedStandardCompare(strR) == .orderedAscending } + log.verbose("Opening dropped files: \(files)") input.open(files: files) } diff --git a/osdep/mac/application.swift b/osdep/mac/application.swift index c66be61647e11..30f37a6f49882 100644 --- a/osdep/mac/application.swift +++ b/osdep/mac/application.swift @@ -88,6 +88,7 @@ class Application: NSApplication, NSApplicationDelegate { let path = (ProcessInfo.processInfo.environment["PATH"] ?? "") + ":/usr/local/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin" + appHub.log.verbose("Setting Bundle $PATH to: \(path)") _ = path.withCString { setenv("PATH", $0, 1) } }