summaryrefslogtreecommitdiffstats
path: root/cmd-find.c
diff options
context:
space:
mode:
authornicm <nicm>2019-03-12 12:49:46 +0000
committernicm <nicm>2019-03-12 12:49:46 +0000
commit7b819357ff5a0f014527a94ce0abb98e472ea358 (patch)
treebbb7d91581018f774428f328c77c8a9bef6f3d9a /cmd-find.c
parent3f6bfbaf2babcc7f08f628a82ff31b0b52014e58 (diff)
Tweak target debug logging.
Diffstat (limited to 'cmd-find.c')
-rw-r--r--cmd-find.c39
1 files changed, 30 insertions, 9 deletions
diff --git a/cmd-find.c b/cmd-find.c
index fe5bb3e0..3cee9d14 100644
--- a/cmd-find.c
+++ b/cmd-find.c
@@ -971,7 +971,7 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item,
{
struct mouse_event *m;
struct cmd_find_state current;
- char *colon, *period, *copy = NULL;
+ char *colon, *period, *copy = NULL, tmp[256];
const char *session, *window, *pane, *s;
int window_only = 0, pane_only = 0;
@@ -988,11 +988,25 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item,
s = "session";
else
s = "unknown";
- if (target == NULL)
- log_debug("%s: target none, type %s", __func__, s);
- else
- log_debug("%s: target %s, type %s", __func__, target, s);
- log_debug("%s: item %p, flags %#x", __func__, item, flags);
+ *tmp = '\0';
+ if (flags & CMD_FIND_PREFER_UNATTACHED)
+ strlcat(tmp, "PREFER_UNATTACHED,", sizeof tmp);
+ if (flags & CMD_FIND_QUIET)
+ strlcat(tmp, "QUIET,", sizeof tmp);
+ if (flags & CMD_FIND_WINDOW_INDEX)
+ strlcat(tmp, "WINDOW_INDEX,", sizeof tmp);
+ if (flags & CMD_FIND_DEFAULT_MARKED)
+ strlcat(tmp, "DEFAULT_MARKED,", sizeof tmp);
+ if (flags & CMD_FIND_EXACT_SESSION)
+ strlcat(tmp, "EXACT_SESSION,", sizeof tmp);
+ if (flags & CMD_FIND_EXACT_WINDOW)
+ strlcat(tmp, "EXACT_WINDOW,", sizeof tmp);
+ if (flags & CMD_FIND_CANFAIL)
+ strlcat(tmp, "CANFAIL,", sizeof tmp);
+ if (*tmp != '\0')
+ tmp[strlen(tmp) - 1] = '\0';
+ log_debug("%s: target %s, type %s, item %p, flags %s", __func__,
+ target == NULL ? "none" : target, s, item, tmp);
/* Clear new state. */
cmd_find_clear_state(fs, flags);
@@ -1132,9 +1146,16 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item,
if (pane != NULL)
pane = cmd_find_map_table(cmd_find_pane_table, pane);
- log_debug("%s: target %s (flags %#x): session=%s, window=%s, pane=%s",
- __func__, target, flags, session == NULL ? "none" : session,
- window == NULL ? "none" : window, pane == NULL ? "none" : pane);
+ if (session != NULL || window != NULL || pane != NULL) {
+ log_debug("%s: target %s is %s%s%s%s%s%s",
+ __func__, target,
+ session == NULL ? "" : "session ",
+ session == NULL ? "" : session,
+ window == NULL ? "" : "window ",
+ window == NULL ? "" : window,
+ pane == NULL ? "" : "pane ",
+ pane == NULL ? "" : pane);
+ }
/* No pane is allowed if want an index. */
if (pane != NULL && (flags & CMD_FIND_WINDOW_INDEX)) {