From 6e8d04c2b88fed4af2c5b0976ec2d74877adca2b Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 16 Jun 2017 15:12:38 +0000 Subject: [PATCH] Tweak some logging. --- usr.bin/tmux/cmd-find.c | 16 ++++++++++++---- usr.bin/tmux/cmd-queue.c | 4 +++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/usr.bin/tmux/cmd-find.c b/usr.bin/tmux/cmd-find.c index 41a6e921ada..9310af7031a 100644 --- a/usr.bin/tmux/cmd-find.c +++ b/usr.bin/tmux/cmd-find.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-find.c,v 1.53 2017/06/14 07:37:17 nicm Exp $ */ +/* $OpenBSD: cmd-find.c,v 1.54 2017/06/16 15:12:38 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -950,7 +950,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; - const char *session, *window, *pane; + const char *session, *window, *pane, *s; int window_only = 0, pane_only = 0; /* Can fail flag implies quiet. */ @@ -958,10 +958,18 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item, flags |= CMD_FIND_QUIET; /* Log the arguments. */ + if (type == CMD_FIND_PANE) + s = "pane"; + else if (type == CMD_FIND_WINDOW) + s = "window"; + else if (type == CMD_FIND_SESSION) + s = "session"; + else + s = "unknown"; if (target == NULL) - log_debug("%s: target none, type %d", __func__, type); + log_debug("%s: target none, type %s", __func__, s); else - log_debug("%s: target %s, type %d", __func__, target, type); + log_debug("%s: target %s, type %s", __func__, target, s); log_debug("%s: item %p, flags %#x", __func__, item, flags); /* Clear new state. */ diff --git a/usr.bin/tmux/cmd-queue.c b/usr.bin/tmux/cmd-queue.c index 9b9e52c64e2..8770c516914 100644 --- a/usr.bin/tmux/cmd-queue.c +++ b/usr.bin/tmux/cmd-queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-queue.c,v 1.56 2017/05/30 21:44:59 nicm Exp $ */ +/* $OpenBSD: cmd-queue.c,v 1.57 2017/06/16 15:12:38 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott @@ -453,6 +453,8 @@ cmdq_error(struct cmdq_item *item, const char *fmt, ...) msglen = xvasprintf(&msg, fmt, ap); va_end(ap); + log_debug("%s: %s", __func__, msg); + if (c == NULL) cfg_add_cause("%s:%u: %s", cmd->file, cmd->line, msg); else if (c->session == NULL || (c->flags & CLIENT_CONTROL)) { -- 2.20.1