aboutsummaryrefslogtreecommitdiff
path: root/src/common/logging.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/logging.c')
-rw-r--r--src/common/logging.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common/logging.c b/src/common/logging.c
index 677c4783..e5ddcea8 100644
--- a/src/common/logging.c
+++ b/src/common/logging.c
@@ -32,6 +32,8 @@
32 32
33static GtkWidget *infoWindowTextView; 33static GtkWidget *infoWindowTextView;
34 34
35static int is_shutdown;
36
35static void 37static void
36init () 38init ()
37{ 39{
@@ -127,6 +129,8 @@ GNUNET_GTK_add_log_entry (const char *txt, ...)
127 va_list args; 129 va_list args;
128 gchar *note; 130 gchar *note;
129 131
132 if (is_shutdown)
133 return;
130 va_start (args, txt); 134 va_start (args, txt);
131 note = g_strdup_vprintf (txt, args); 135 note = g_strdup_vprintf (txt, args);
132 va_end (args); 136 va_end (args);
@@ -139,9 +143,17 @@ static void
139ge_gtk_log_handler (void *ctx, 143ge_gtk_log_handler (void *ctx,
140 GNUNET_GE_KIND kind, const char *date, const char *msg) 144 GNUNET_GE_KIND kind, const char *date, const char *msg)
141{ 145{
146 if (is_shutdown)
147 return;
142 GNUNET_GTK_show_info_message ("%s: %s", date, msg); 148 GNUNET_GTK_show_info_message ("%s: %s", date, msg);
143} 149}
144 150
151void
152GNUNET_GTK_shutdown_logger()
153{
154 is_shutdown = GNUNET_YES;
155}
156
145struct GNUNET_GE_Context * 157struct GNUNET_GE_Context *
146GNUNET_GTK_create_gtk_logger (GNUNET_GE_KIND mask) 158GNUNET_GTK_create_gtk_logger (GNUNET_GE_KIND mask)
147{ 159{