From af04a8d5dab019f05afbe59cc1250495c5aad048 Mon Sep 17 00:00:00 2001 From: Lorenzo Miniero Date: Thu, 24 Oct 2024 10:08:54 +0200 Subject: [PATCH] Print what's left in the buffer when destroying the logger (see #3462) --- src/log.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/log.c b/src/log.c index e688433356..bf338454be 100644 --- a/src/log.c +++ b/src/log.c @@ -98,6 +98,12 @@ static void *janus_log_thread(void *ctx) { /* Done, get rid of this log line */ janus_log_buffer_free(b); } + /* Print all that's left to print */ + while((b = g_async_queue_try_pop(janus_log_queue)) != NULL) { + if(b->str != NULL) + janus_log_print_buffer(b); + janus_log_buffer_free(b); + } if(janus_log_console) fflush(stdout); if(janus_log_file)