Skip to content

Commit

Permalink
include pid in debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
koekeishiya committed May 22, 2020
1 parent 35a9943 commit dcd88f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/process_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down
12 changes: 6 additions & 6 deletions src/workspace.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand All @@ -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);
}
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand Down Expand Up @@ -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);

Expand All @@ -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);

Expand Down

0 comments on commit dcd88f1

Please sign in to comment.