Switched drag-n-drop logging to trace level

The logging is extremely verbose and covers the entire data exchange process, which is more suited to the trace level.
This commit is contained in:
Sam Lantinga
2024-10-09 07:35:21 -07:00
parent 5b6342a00d
commit 1f08a03794
3 changed files with 26 additions and 26 deletions

View File

@@ -199,7 +199,7 @@
- (BOOL)performDragOperation:(id<NSDraggingInfo>)sender - (BOOL)performDragOperation:(id<NSDraggingInfo>)sender
{ {
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". [SDL] In performDragOperation, draggingSourceOperationMask %lx, " ". [SDL] In performDragOperation, draggingSourceOperationMask %lx, "
"expected Generic %lx, others Copy %lx, Link %lx, Private %lx, Move %lx, Delete %lx\n", "expected Generic %lx, others Copy %lx, Link %lx, Private %lx, Move %lx, Delete %lx\n",
(unsigned long)[sender draggingSourceOperationMask], (unsigned long)[sender draggingSourceOperationMask],
@@ -210,7 +210,7 @@
(unsigned long)NSDragOperationMove, (unsigned long)NSDragOperationMove,
(unsigned long)NSDragOperationDelete); (unsigned long)NSDragOperationDelete);
if ([sender draggingPasteboard]) { if ([sender draggingPasteboard]) {
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". [SDL] In performDragOperation, valid draggingPasteboard, " ". [SDL] In performDragOperation, valid draggingPasteboard, "
"name [%s] '%s', changeCount %ld\n", "name [%s] '%s', changeCount %ld\n",
[[[[sender draggingPasteboard] name] className] UTF8String], [[[[sender draggingPasteboard] name] className] UTF8String],
@@ -229,7 +229,7 @@
for (NSString *supportedType in [pasteboard types]) { for (NSString *supportedType in [pasteboard types]) {
NSString *typeString = [pasteboard stringForType:supportedType]; NSString *typeString = [pasteboard stringForType:supportedType];
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". [SDL] In performDragOperation, Pasteboard type '%s', stringForType (%lu) '%s'\n", ". [SDL] In performDragOperation, Pasteboard type '%s', stringForType (%lu) '%s'\n",
[[supportedType description] UTF8String], [[supportedType description] UTF8String],
(unsigned long)[[typeString description] length], (unsigned long)[[typeString description] length],
@@ -281,7 +281,7 @@
} }
} }
} }
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". [SDL] In performDragOperation, desiredType '%s', " ". [SDL] In performDragOperation, desiredType '%s', "
"Submitting DropFile as (%lu) '%s'\n", "Submitting DropFile as (%lu) '%s'\n",
[[desiredType description] UTF8String], [[desiredType description] UTF8String],
@@ -296,7 +296,7 @@
char *saveptr = NULL; char *saveptr = NULL;
char *token = SDL_strtok_r(buffer, "\r\n", &saveptr); char *token = SDL_strtok_r(buffer, "\r\n", &saveptr);
while (token) { while (token) {
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". [SDL] In performDragOperation, desiredType '%s', " ". [SDL] In performDragOperation, desiredType '%s', "
"Submitting DropText as (%lu) '%s'\n", "Submitting DropText as (%lu) '%s'\n",
[[desiredType description] UTF8String], [[desiredType description] UTF8String],

View File

@@ -381,7 +381,7 @@ void *Wayland_data_offer_receive(SDL_WaylandDataOffer *offer,
} }
close(pipefd[0]); close(pipefd[0]);
} }
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In Wayland_data_offer_receive for '%s', buffer (%ld) at %p\n", ". In Wayland_data_offer_receive for '%s', buffer (%ld) at %p\n",
mime_type, *length, buffer); mime_type, *length, buffer);
return buffer; return buffer;
@@ -417,7 +417,7 @@ void *Wayland_primary_selection_offer_receive(SDL_WaylandPrimarySelectionOffer *
} }
close(pipefd[0]); close(pipefd[0]);
} }
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In Wayland_primary_selection_offer_receive for '%s', buffer (%ld) at %p\n", ". In Wayland_primary_selection_offer_receive for '%s', buffer (%ld) at %p\n",
mime_type, *length, buffer); mime_type, *length, buffer);
return buffer; return buffer;

View File

@@ -1991,7 +1991,7 @@ static void data_offer_handle_offer(void *data, struct wl_data_offer *wl_data_of
{ {
SDL_WaylandDataOffer *offer = data; SDL_WaylandDataOffer *offer = data;
Wayland_data_offer_add_mime(offer, mime_type); Wayland_data_offer_add_mime(offer, mime_type);
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In wl_data_offer_listener . data_offer_handle_offer on data_offer 0x%08x for MIME '%s'\n", ". In wl_data_offer_listener . data_offer_handle_offer on data_offer 0x%08x for MIME '%s'\n",
(wl_data_offer ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)wl_data_offer) : -1), (wl_data_offer ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)wl_data_offer) : -1),
mime_type); mime_type);
@@ -2000,7 +2000,7 @@ static void data_offer_handle_offer(void *data, struct wl_data_offer *wl_data_of
static void data_offer_handle_source_actions(void *data, struct wl_data_offer *wl_data_offer, static void data_offer_handle_source_actions(void *data, struct wl_data_offer *wl_data_offer,
uint32_t source_actions) uint32_t source_actions)
{ {
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In wl_data_offer_listener . data_offer_handle_source_actions on data_offer 0x%08x for Source Actions '%d'\n", ". In wl_data_offer_listener . data_offer_handle_source_actions on data_offer 0x%08x for Source Actions '%d'\n",
(wl_data_offer ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)wl_data_offer) : -1), (wl_data_offer ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)wl_data_offer) : -1),
source_actions); source_actions);
@@ -2009,7 +2009,7 @@ static void data_offer_handle_source_actions(void *data, struct wl_data_offer *w
static void data_offer_handle_actions(void *data, struct wl_data_offer *wl_data_offer, static void data_offer_handle_actions(void *data, struct wl_data_offer *wl_data_offer,
uint32_t dnd_action) uint32_t dnd_action)
{ {
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In wl_data_offer_listener . data_offer_handle_actions on data_offer 0x%08x for DND Actions '%d'\n", ". In wl_data_offer_listener . data_offer_handle_actions on data_offer 0x%08x for DND Actions '%d'\n",
(wl_data_offer ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)wl_data_offer) : -1), (wl_data_offer ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)wl_data_offer) : -1),
dnd_action); dnd_action);
@@ -2026,7 +2026,7 @@ static void primary_selection_offer_handle_offer(void *data, struct zwp_primary_
{ {
SDL_WaylandPrimarySelectionOffer *offer = data; SDL_WaylandPrimarySelectionOffer *offer = data;
Wayland_primary_selection_offer_add_mime(offer, mime_type); Wayland_primary_selection_offer_add_mime(offer, mime_type);
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In zwp_primary_selection_offer_v1_listener . primary_selection_offer_handle_offer on primary_selection_offer 0x%08x for MIME '%s'\n", ". In zwp_primary_selection_offer_v1_listener . primary_selection_offer_handle_offer on primary_selection_offer 0x%08x for MIME '%s'\n",
(zwp_primary_selection_offer_v1 ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)zwp_primary_selection_offer_v1) : -1), (zwp_primary_selection_offer_v1 ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)zwp_primary_selection_offer_v1) : -1),
mime_type); mime_type);
@@ -2046,7 +2046,7 @@ static void data_device_handle_data_offer(void *data, struct wl_data_device *wl_
WAYLAND_wl_list_init(&(data_offer->mimes)); WAYLAND_wl_list_init(&(data_offer->mimes));
wl_data_offer_set_user_data(id, data_offer); wl_data_offer_set_user_data(id, data_offer);
wl_data_offer_add_listener(id, &data_offer_listener, data_offer); wl_data_offer_add_listener(id, &data_offer_listener, data_offer);
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In wl_data_device_listener . data_device_handle_data_offer on data_offer 0x%08x\n", ". In wl_data_device_listener . data_device_handle_data_offer on data_offer 0x%08x\n",
(id ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)id) : -1)); (id ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)id) : -1));
} }
@@ -2104,25 +2104,25 @@ static void data_device_handle_enter(void *data, struct wl_data_device *wl_data_
const float dx = (float)wl_fixed_to_double(x); const float dx = (float)wl_fixed_to_double(x);
const float dy = (float)wl_fixed_to_double(y); const float dy = (float)wl_fixed_to_double(y);
SDL_SendDropPosition(data_device->dnd_window, dx, dy); SDL_SendDropPosition(data_device->dnd_window, dx, dy);
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In wl_data_device_listener . data_device_handle_enter on data_offer 0x%08x at %d x %d into window %d for serial %d\n", ". In wl_data_device_listener . data_device_handle_enter on data_offer 0x%08x at %d x %d into window %d for serial %d\n",
WAYLAND_wl_proxy_get_id((struct wl_proxy *)id), WAYLAND_wl_proxy_get_id((struct wl_proxy *)id),
wl_fixed_to_int(x), wl_fixed_to_int(y), SDL_GetWindowID(data_device->dnd_window), serial); wl_fixed_to_int(x), wl_fixed_to_int(y), SDL_GetWindowID(data_device->dnd_window), serial);
} else { } else {
data_device->dnd_window = NULL; data_device->dnd_window = NULL;
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In wl_data_device_listener . data_device_handle_enter on data_offer 0x%08x at %d x %d for serial %d\n", ". In wl_data_device_listener . data_device_handle_enter on data_offer 0x%08x at %d x %d for serial %d\n",
WAYLAND_wl_proxy_get_id((struct wl_proxy *)id), WAYLAND_wl_proxy_get_id((struct wl_proxy *)id),
wl_fixed_to_int(x), wl_fixed_to_int(y), serial); wl_fixed_to_int(x), wl_fixed_to_int(y), serial);
} }
} else { } else {
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In wl_data_device_listener . data_device_handle_enter on data_offer 0x%08x at %d x %d for serial %d\n", ". In wl_data_device_listener . data_device_handle_enter on data_offer 0x%08x at %d x %d for serial %d\n",
WAYLAND_wl_proxy_get_id((struct wl_proxy *)id), WAYLAND_wl_proxy_get_id((struct wl_proxy *)id),
wl_fixed_to_int(x), wl_fixed_to_int(y), serial); wl_fixed_to_int(x), wl_fixed_to_int(y), serial);
} }
} else { } else {
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In wl_data_device_listener . data_device_handle_enter on data_offer 0x%08x at %d x %d for serial %d\n", ". In wl_data_device_listener . data_device_handle_enter on data_offer 0x%08x at %d x %d for serial %d\n",
-1, wl_fixed_to_int(x), wl_fixed_to_int(y), serial); -1, wl_fixed_to_int(x), wl_fixed_to_int(y), serial);
} }
@@ -2134,12 +2134,12 @@ static void data_device_handle_leave(void *data, struct wl_data_device *wl_data_
if (data_device->drag_offer) { if (data_device->drag_offer) {
if (data_device->dnd_window) { if (data_device->dnd_window) {
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In wl_data_device_listener . data_device_handle_leave on data_offer 0x%08x from window %d for serial %d\n", ". In wl_data_device_listener . data_device_handle_leave on data_offer 0x%08x from window %d for serial %d\n",
WAYLAND_wl_proxy_get_id((struct wl_proxy *)data_device->drag_offer->offer), WAYLAND_wl_proxy_get_id((struct wl_proxy *)data_device->drag_offer->offer),
SDL_GetWindowID(data_device->dnd_window), data_device->drag_serial); SDL_GetWindowID(data_device->dnd_window), data_device->drag_serial);
} else { } else {
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In wl_data_device_listener . data_device_handle_leave on data_offer 0x%08x for serial %d\n", ". In wl_data_device_listener . data_device_handle_leave on data_offer 0x%08x for serial %d\n",
WAYLAND_wl_proxy_get_id((struct wl_proxy *)data_device->drag_offer->offer), WAYLAND_wl_proxy_get_id((struct wl_proxy *)data_device->drag_offer->offer),
data_device->drag_serial); data_device->drag_serial);
@@ -2147,7 +2147,7 @@ static void data_device_handle_leave(void *data, struct wl_data_device *wl_data_
Wayland_data_offer_destroy(data_device->drag_offer); Wayland_data_offer_destroy(data_device->drag_offer);
data_device->drag_offer = NULL; data_device->drag_offer = NULL;
} else { } else {
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In wl_data_device_listener . data_device_handle_leave on data_offer 0x%08x for serial %d\n", ". In wl_data_device_listener . data_device_handle_leave on data_offer 0x%08x for serial %d\n",
-1, -1); -1, -1);
} }
@@ -2169,13 +2169,13 @@ static void data_device_handle_motion(void *data, struct wl_data_device *wl_data
* hammer the DBus interface hundreds or even thousands of times per second. * hammer the DBus interface hundreds or even thousands of times per second.
*/ */
SDL_SendDropPosition(data_device->dnd_window, dx, dy); SDL_SendDropPosition(data_device->dnd_window, dx, dy);
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In wl_data_device_listener . data_device_handle_motion on data_offer 0x%08x at %d x %d in window %d serial %d\n", ". In wl_data_device_listener . data_device_handle_motion on data_offer 0x%08x at %d x %d in window %d serial %d\n",
WAYLAND_wl_proxy_get_id((struct wl_proxy *)data_device->drag_offer->offer), WAYLAND_wl_proxy_get_id((struct wl_proxy *)data_device->drag_offer->offer),
wl_fixed_to_int(x), wl_fixed_to_int(y), wl_fixed_to_int(x), wl_fixed_to_int(y),
SDL_GetWindowID(data_device->dnd_window), data_device->drag_serial); SDL_GetWindowID(data_device->dnd_window), data_device->drag_serial);
} else { } else {
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In wl_data_device_listener . data_device_handle_motion on data_offer 0x%08x at %d x %d serial %d\n", ". In wl_data_device_listener . data_device_handle_motion on data_offer 0x%08x at %d x %d serial %d\n",
-1, wl_fixed_to_int(x), wl_fixed_to_int(y), -1); -1, wl_fixed_to_int(x), wl_fixed_to_int(y), -1);
} }
@@ -2186,7 +2186,7 @@ static void data_device_handle_drop(void *data, struct wl_data_device *wl_data_d
SDL_WaylandDataDevice *data_device = data; SDL_WaylandDataDevice *data_device = data;
if (data_device->drag_offer && data_device->dnd_window && (data_device->has_mime_file || data_device->has_mime_text)) { if (data_device->drag_offer && data_device->dnd_window && (data_device->has_mime_file || data_device->has_mime_text)) {
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In wl_data_device_listener . data_device_handle_drop on data_offer 0x%08x in window %d serial %d\n", ". In wl_data_device_listener . data_device_handle_drop on data_offer 0x%08x in window %d serial %d\n",
WAYLAND_wl_proxy_get_id((struct wl_proxy *)data_device->drag_offer->offer), WAYLAND_wl_proxy_get_id((struct wl_proxy *)data_device->drag_offer->offer),
SDL_GetWindowID(data_device->dnd_window), data_device->drag_serial); SDL_GetWindowID(data_device->dnd_window), data_device->drag_serial);
@@ -2268,7 +2268,7 @@ static void data_device_handle_drop(void *data, struct wl_data_device *wl_data_d
wl_data_offer_finish(data_device->drag_offer->offer); wl_data_offer_finish(data_device->drag_offer->offer);
} }
} else { } else {
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In wl_data_device_listener . data_device_handle_drop on data_offer 0x%08x serial %d\n", ". In wl_data_device_listener . data_device_handle_drop on data_offer 0x%08x serial %d\n",
-1, -1); -1, -1);
} }
@@ -2321,7 +2321,7 @@ static void data_device_handle_selection(void *data, struct wl_data_device *wl_d
offer = wl_data_offer_get_user_data(id); offer = wl_data_offer_get_user_data(id);
} }
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In data_device_listener . data_device_handle_selection on data_offer 0x%08x\n", ". In data_device_listener . data_device_handle_selection on data_offer 0x%08x\n",
(id ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)id) : -1)); (id ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)id) : -1));
if (data_device->selection_offer != offer) { if (data_device->selection_offer != offer) {
@@ -2352,7 +2352,7 @@ static void primary_selection_device_handle_offer(void *data, struct zwp_primary
zwp_primary_selection_offer_v1_set_user_data(id, primary_selection_offer); zwp_primary_selection_offer_v1_set_user_data(id, primary_selection_offer);
zwp_primary_selection_offer_v1_add_listener(id, &primary_selection_offer_listener, primary_selection_offer); zwp_primary_selection_offer_v1_add_listener(id, &primary_selection_offer_listener, primary_selection_offer);
} }
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In zwp_primary_selection_device_v1_listener . primary_selection_device_handle_offer on primary_selection_offer 0x%08x\n", ". In zwp_primary_selection_device_v1_listener . primary_selection_device_handle_offer on primary_selection_offer 0x%08x\n",
(id ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)id) : -1)); (id ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)id) : -1));
} }
@@ -2371,7 +2371,7 @@ static void primary_selection_device_handle_selection(void *data, struct zwp_pri
Wayland_primary_selection_offer_destroy(primary_selection_device->selection_offer); Wayland_primary_selection_offer_destroy(primary_selection_device->selection_offer);
primary_selection_device->selection_offer = offer; primary_selection_device->selection_offer = offer;
} }
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, SDL_LogTrace(SDL_LOG_CATEGORY_INPUT,
". In zwp_primary_selection_device_v1_listener . primary_selection_device_handle_selection on primary_selection_offer 0x%08x\n", ". In zwp_primary_selection_device_v1_listener . primary_selection_device_handle_selection on primary_selection_offer 0x%08x\n",
(id ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)id) : -1)); (id ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)id) : -1));