-#if !TDM_WAYLAND_LOGGER
-
-static void
-_trace_protocol_cb(struct wl_closure *closure, struct wl_resource *resource, int send)
-{
- int i;
- struct argument_details arg;
- struct wl_object *object = &resource->object;
- struct wl_client *client = resource->client;
- const char *signature = closure->message->signature;
- struct timespec tp;
- unsigned int time;
- pid_t pid = -1;
- const char *proc_name;
- char temp[512] = { 0, }, *p = temp;
- int len = sizeof(temp), *l = &len;
-
- if (client) {
- _trace_reg_client_destroy_listener(client);
- wl_client_get_credentials(client, &pid, NULL, NULL);
- }
-
- proc_name = tdm_server_get_client_name(pid);
-
- clock_gettime(CLOCK_MONOTONIC, &tp);
- time = (tp.tv_sec * 1000000L) + (tp.tv_nsec / 1000);
-
- TDM_SNPRINTF(p, l, "[%10.3f] %s%d%s%s@%u.%s(",
- time / 1000.0,
- send ? "Server -> Client [PID:" : "Server <- Client [PID:",
- pid, "] ",
- object->interface->name, object->id, closure->message->name);
-
- for (i = 0; i < closure->count; i++) {
- signature = _trace_get_next_argument(signature, &arg);
- TDM_RETURN_IF_FAIL(signature != NULL);
-
- if (i > 0)
- TDM_SNPRINTF(p, l, ", ");
-
- switch (arg.type) {
- case 'u':
- TDM_SNPRINTF(p, l, "%u", closure->args[i].u);
- break;
- case 'i':
- TDM_SNPRINTF(p, l, "%d", closure->args[i].i);
- break;
- case 'f':
- TDM_SNPRINTF(p, l, "%f", wl_fixed_to_double(closure->args[i].f));
- break;
- case 's':
- TDM_SNPRINTF(p, l, "\"%s\"", closure->args[i].s);
- break;
- case 'o':
- if (closure->args[i].o)
- TDM_SNPRINTF(p, l, "%s@%u", closure->args[i].o->interface->name, closure->args[i].o->id);
- else
- TDM_SNPRINTF(p, l, "nil");
- break;
- case 'n':
- TDM_SNPRINTF(p, l, "new id %s@",
- (closure->message->types[i]) ? closure->message->types[i]->name : "[unknown]");
- if (closure->args[i].n != 0)
- TDM_SNPRINTF(p, l, "%u", closure->args[i].n);
- else
- TDM_SNPRINTF(p, l, "nil");
- break;
- case 'a':
- TDM_SNPRINTF(p, l, "array");
- break;
- case 'h':
- TDM_SNPRINTF(p, l, "fd %d", closure->args[i].h);
- break;
- default:
- return;
- }
- }
-
- TDM_SNPRINTF(p, l, "), cmd: %s", proc_name ? proc_name : "Unknown");
-
- TDM_INFO("%s", temp);
-}
-
-#else
-