From dcd88f139f48e3ff3d9b918701a772d99c31c221 Mon Sep 17 00:00:00 2001 From: koekeishiya Date: Fri, 22 May 2020 13:57:48 +0200 Subject: [PATCH] include pid in debug logs --- src/process_manager.c | 4 ++-- src/workspace.m | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/process_manager.c b/src/process_manager.c index cf84d83e..6d7237bf 100644 --- a/src/process_manager.c +++ b/src/process_manager.c @@ -46,7 +46,7 @@ void process_destroy(struct process *process) static bool process_is_observable(struct process *process) { if (process->xpc) { - debug("%s: %s was marked as xpc service! ignoring..\n", __FUNCTION__, process->name); + debug("%s: %s (%d) was marked as xpc service! ignoring..\n", __FUNCTION__, process->name, process->pid); return false; } @@ -118,7 +118,7 @@ process_manager_add_running_processes(struct process_manager *pm) if (process_is_observable(process)) { if (string_equals(process->name, "Finder")) { - debug("%s: %s was found! caching psn..\n", __FUNCTION__, process->name); + debug("%s: %s (%d) was found! caching psn..\n", __FUNCTION__, process->name, process->pid); pm->finder_psn = psn; } diff --git a/src/workspace.m b/src/workspace.m index 178a6c0a..d9c39322 100644 --- a/src/workspace.m +++ b/src/workspace.m @@ -26,7 +26,7 @@ void workspace_application_observe_finished_launching(void *context, struct proc if (application) { [application addObserver:context forKeyPath:@"finishedLaunching" options:NSKeyValueObservingOptionInitial|NSKeyValueObservingOptionNew context:process]; } else { - debug("%s: could not subscribe to activation policy changes for %s\n", __FUNCTION__, process->name); + debug("%s: could not subscribe to activation policy changes for %s (%d)\n", __FUNCTION__, process->name, process->pid); } } @@ -36,7 +36,7 @@ void workspace_application_observe_activation_policy(void *context, struct proce if (application) { [application addObserver:context forKeyPath:@"activationPolicy" options:NSKeyValueObservingOptionInitial|NSKeyValueObservingOptionNew context:process]; } else { - debug("%s: could not subscribe to finished launching changes for %s\n", __FUNCTION__, process->name); + debug("%s: could not subscribe to finished launching changes for %s (%d)\n", __FUNCTION__, process->name, process->pid); } } @@ -50,7 +50,7 @@ bool workspace_application_is_observable(struct process *process) return result; } - debug("%s: could not determine observability status for %s\n", __FUNCTION__, process->name); + debug("%s: could not determine observability status for %s (%d)\n", __FUNCTION__, process->name, process->pid); return false; } @@ -64,7 +64,7 @@ bool workspace_application_is_finished_launching(struct process *process) return result; } - debug("%s: could not determine launch status for %s\n", __FUNCTION__, process->name); + debug("%s: could not determine launch status for %s (%d)\n", __FUNCTION__, process->name, process->pid); return false; } @@ -132,7 +132,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N struct process *process = context; assert(!process->terminated); - debug("%s: activation policy changed for %s\n", __FUNCTION__, process->name); + debug("%s: activation policy changed for %s (%d)\n", __FUNCTION__, process->name, process->pid); struct event *event = event_create(&g_event_loop, APPLICATION_LAUNCHED, process); event_loop_post(&g_event_loop, event); @@ -157,7 +157,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N struct process *process = context; assert(!process->terminated); - debug("%s: %s finished launching\n", __FUNCTION__, process->name); + debug("%s: %s (%d) finished launching\n", __FUNCTION__, process->name, process->pid); struct event *event = event_create(&g_event_loop, APPLICATION_LAUNCHED, process); event_loop_post(&g_event_loop, event);