]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/action.c: Improve debugging by adding action argument to debug log
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Fri, 6 Jan 2023 17:44:13 +0000 (18:44 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Fri, 6 Jan 2023 21:38:12 +0000 (21:38 +0000)
src/action.c

index 622f97310593304608285a8617e4495036f86e1b..c191bdbd49336946b4ab1558ae08b845ecbaabbd 100644 (file)
@@ -253,12 +253,18 @@ actions_run(struct view *activator, struct server *server,
        struct action *action;
        struct action_arg *arg;
        wl_list_for_each(action, actions, link) {
-               wlr_log(WLR_DEBUG, "Handling action %s (%u)",
-                        action_names[action->type], action->type);
-
                /* Get arg now so we don't have to repeat every time we only need one */
                arg = action_get_first_arg(action);
 
+               if (arg && arg->type == LAB_ACTION_ARG_STR) {
+                       wlr_log(WLR_DEBUG, "Handling action %u: %s %s",
+                               action->type, action_names[action->type],
+                               action_str_from_arg(arg));
+               } else {
+                       wlr_log(WLR_DEBUG, "Handling action %u: %s",
+                               action->type, action_names[action->type]);
+               }
+
                /*
                 * Refetch view because it may have been changed due to the
                 * previous action