]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Print assertions from glib to rspamd logger.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 22 Sep 2015 15:08:44 +0000 (16:08 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 22 Sep 2015 15:08:44 +0000 (16:08 +0100)
src/libutil/logger.c
src/libutil/logger.h
src/main.c

index d8e78ae63a3424797697cf9101bb6c1d7b65ad8a..57410ad96f66a187223e813650543da14d0156bb 100644 (file)
@@ -920,6 +920,13 @@ rspamd_glib_log_function (const gchar *log_domain,
        }
 }
 
+void
+rspamd_glib_printerr_function (const gchar *message)
+{
+       rspamd_common_logv (NULL, G_LOG_LEVEL_CRITICAL, "glib", NULL, G_STRFUNC,
+                       message, NULL);
+}
+
 /**
  * Temporary turn on debugging
  */
index c3eb6d2cfa3979eded324aa6c0f63999807a51e0..e8c71465bbc4dc3efa853e1d77438960e33ba480 100644 (file)
@@ -67,6 +67,11 @@ void rspamd_log_flush (rspamd_logger_t *logger);
 void rspamd_glib_log_function (const gchar *log_domain,
                GLogLevelFlags log_level, const gchar *message, gpointer arg);
 
+/**
+ * Log function for printing glib assertions
+ */
+void rspamd_glib_printerr_function (const gchar *message);
+
 /**
  * Function with variable number of arguments support
  */
index e13925d337188416664a39db020e3c882e0b81e5..87de76bee78b171552561a1c7f368f252839a483 100644 (file)
@@ -1143,6 +1143,7 @@ main (gint argc, gchar **argv, gchar **env)
        rspamd_set_logger (rspamd_main->cfg, type, rspamd_main);
        (void)rspamd_log_open (rspamd_main->logger);
        g_log_set_default_handler (rspamd_glib_log_function, rspamd_main->logger);
+       g_set_printerr_handler (rspamd_glib_printerr_function);
 
        detect_priv (rspamd_main);