From d8794e2b30f92db606a9f6e80316696d90240793 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 10 Feb 2026 08:31:45 +0000 Subject: [PATCH] Check log level before log_debug in tty_draw_line, from Conor Taylor in GitHub issue 4848. --- tty-draw.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tty-draw.c b/tty-draw.c index c506853d..eaf56d2b 100644 --- a/tty-draw.c +++ b/tty-draw.c @@ -262,10 +262,12 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int px, u_int py, u_int nx, else next_state = TTY_DRAW_LINE_NEW1; } - log_debug("%s: cell %u empty %u, bg %u; state: current %s, " - "next %s", __func__, px + i, empty, gcp->bg, - tty_draw_line_states[current_state], - tty_draw_line_states[next_state]); + if (log_get_level() != 0) { + log_debug("%s: cell %u empty %u, bg %u; state: " + "current %s, next %s", __func__, px + i, empty, + gcp->bg, tty_draw_line_states[current_state], + tty_draw_line_states[next_state]); + } /* If the state has changed, flush any collected data. */ if (next_state != current_state) {