diff options
| author | Derek Foreman <derek.foreman@collabora.com> | 2023-11-10 14:21:48 -0600 |
|---|---|---|
| committer | Daniel Stone <daniels@collabora.com> | 2024-01-22 12:34:14 +0000 |
| commit | b42218f790033c496c48c7d5ba1f8421db794d0b (patch) | |
| tree | 3cccd51396bc8bed4db77f2b9c271016b652efd1 /src/connection.c | |
| parent | connection: Spruce up logging for client errors. (diff) | |
| download | wayland-b42218f790033c496c48c7d5ba1f8421db794d0b.tar wayland-b42218f790033c496c48c7d5ba1f8421db794d0b.tar.gz wayland-b42218f790033c496c48c7d5ba1f8421db794d0b.tar.bz2 wayland-b42218f790033c496c48c7d5ba1f8421db794d0b.tar.lz wayland-b42218f790033c496c48c7d5ba1f8421db794d0b.tar.xz wayland-b42218f790033c496c48c7d5ba1f8421db794d0b.tar.zst wayland-b42218f790033c496c48c7d5ba1f8421db794d0b.zip | |
client: Allow setting names for queues
Allow setting a name for an event queue. The queue is used only for
printing additional debug information.
Debug output can now show the name of the event queue an event is
dispatched from, or the event queue of a proxy when a request is made.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Diffstat (limited to 'src/connection.c')
| -rw-r--r-- | src/connection.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/connection.c b/src/connection.c index a6ad410..b89166f 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1283,7 +1283,8 @@ wl_closure_queue(struct wl_closure *closure, struct wl_connection *connection) void wl_closure_print(struct wl_closure *closure, struct wl_object *target, - int send, int discarded, uint32_t (*n_parse)(union wl_argument *arg)) + int send, int discarded, uint32_t (*n_parse)(union wl_argument *arg), + const char *queue_name) { int i; struct argument_details arg; @@ -1302,8 +1303,12 @@ wl_closure_print(struct wl_closure *closure, struct wl_object *target, clock_gettime(CLOCK_REALTIME, &tp); time = (tp.tv_sec * 1000000L) + (tp.tv_nsec / 1000); - fprintf(f, "[%7u.%03u] %s%s%s#%u.%s(", - time / 1000, time % 1000, + fprintf(f, "[%7u.%03u] ", time / 1000, time % 1000); + + if (queue_name) + fprintf(f, "{%s} ", queue_name); + + fprintf(f, "%s%s%s#%u.%s(", discarded ? "discarded " : "", send ? " -> " : "", target->interface->name, target->id, |
