diff options
Diffstat (limited to 'src/remmina_log.c')
-rw-r--r-- | src/remmina_log.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/remmina_log.c b/src/remmina_log.c index f208338e3..0b9d389e3 100644 --- a/src/remmina_log.c +++ b/src/remmina_log.c @@ -226,14 +226,14 @@ void _remmina_message(const gchar *fmt, ...) // always appends newline g_message ("%s", text); + if (!log_window) { + return; + } + g_autofree gchar *buf_tmp = g_strconcat(text, "\n", NULL); /* freed in remmina_log_print_real */ gchar *bufn = g_strconcat("(MESSAGE) - ", buf_tmp, NULL); - if (!log_window) { - free(bufn); - return; - } IDLE_ADD(remmina_log_print_real, bufn); } @@ -258,14 +258,14 @@ void _remmina_debug(const gchar *fun, const gchar *fmt, ...) // always appends newline g_debug ("%s", buf); + if (!log_window) { + return; + } + g_autofree gchar *buf_tmp = g_strconcat(buf, "\n", NULL); /* freed in remmina_log_print_real */ gchar *bufn = g_strconcat("(DEBUG) - ", buf_tmp, NULL); - if (!log_window) { - free(bufn); - return; - } IDLE_ADD(remmina_log_print_real, bufn); } @@ -285,14 +285,14 @@ void _remmina_warning(const gchar *fun, const gchar *fmt, ...) // always appends newline g_warning ("%s", buf); + if (!log_window) { + return; + } + g_autofree gchar *buf_tmp = g_strconcat(buf, "\n", NULL); /* freed in remmina_log_print_real */ gchar *bufn = g_strconcat("(WARN) - ", buf_tmp, NULL); - if (!log_window) { - free(bufn); - return; - } IDLE_ADD(remmina_log_print_real, bufn); } @@ -314,14 +314,14 @@ void _remmina_error(const gchar *fun, const gchar *fmt, ...) // always appends newline g_error ("%s", buf); + if (!log_window) { + return; + } + g_autofree gchar *buf_tmp = g_strconcat(buf, "\n", NULL); /* freed in remmina_log_print_real */ gchar *bufn = g_strconcat("(ERROR) - ", buf_tmp, NULL); - if (!log_window) { - free(bufn); - return; - } IDLE_ADD(remmina_log_print_real, bufn); } @@ -341,19 +341,19 @@ void _remmina_critical(const gchar *fun, const gchar *fmt, ...) // always appends newline g_critical ("%s", buf); + if (!log_window) { + return; + } + g_autofree gchar *buf_tmp = g_strconcat(buf, "\n", NULL); /* freed in remmina_log_print_real */ gchar *bufn = g_strconcat("(CRIT) - ", buf_tmp, NULL); - if (!log_window) { - free(bufn); - return; - } IDLE_ADD(remmina_log_print_real, bufn); } // Only prints into Remmina's own debug window. (Not stdout!) -// See _remmina_{debug, info, error, critical, warning} +// See _remmina_{message, info, debug warning, error, critical} void remmina_log_printf(const gchar *fmt, ...) { TRACE_CALL(__func__); |