libs: check: handle criticals and warnings for new gstreamer log domains
authorTim-Philipp Müller <tim@centricular.com>
Wed, 6 Oct 2021 00:30:03 +0000 (01:30 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 19 Oct 2021 00:12:25 +0000 (00:12 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1009>

subprojects/gstreamer/libs/gst/check/gstcheck.c

index 68b4cd3..0b6b22d 100644 (file)
@@ -332,6 +332,52 @@ gst_check_deinit (void)
   gst_check_clear_log_filter ();
 }
 
+static const gchar *log_domains[] = {
+  "GLib-GObject",
+  "GLib-GIO",
+  "GLib",
+  "GStreamer-AdaptiveDemux",
+  "GStreamer-Allocators",
+  "GStreamer-App",
+  "GStreamer-Audio",
+  "GStreamer-AudioBad",
+  "GStreamer-Base",
+  "GStreamer-BaseCameraBinSrc",
+  "GStreamer-Check",
+  "GStreamer-CodecParsers",
+  "GStreamer-Codecs",
+  "GStreamer-Controller",
+  "GStreamer-D3D11",
+  "GStreamer",
+  "GStreamer-FFT",
+  "GStreamer-GL",
+  "GStreamer-InsertBin",
+  "GStreamer-ISOFF",
+  "GStreamer-MpegTS",
+  "GStreamer-Net",
+  "GStreamer-OpenCV",
+  "GStreamer-PBUtils",
+  "GStreamer-Photography",
+  "GStreamer-Play",
+  "GStreamer-Player",
+  "GStreamer-RIFF",
+  "GStreamer-RTP",
+  "GStreamer-RTSP",
+  "GStreamer-RTSP-Server",
+  "GStreamer-SCTP",
+  "GStreamer-SDP",
+  "GStreamer-Tag",
+  "GStreamer-Transcoder",
+  "GStreamer-UriDownloader",
+  "GStreamer-VA",
+  "GStreamer-Video",
+  "GStreamer-Vulkan",
+  "GStreamer-Vulkan",
+  "GStreamer-Wayland",
+  "GStreamer-WebRTC",
+  "GStreamer-WinRT",
+};
+
 /* gst_check_init:
  * @argc: (inout) (allow-none): pointer to application's argc
  * @argv: (inout) (array length=argc) (allow-none): pointer to application's argv
@@ -352,6 +398,7 @@ gst_check_init (int *argc, char **argv[])
         "List tests present in the testsuite", NULL},
     {NULL}
   };
+  guint i;
 
   ctx = g_option_context_new ("gst-check");
   g_option_context_add_main_entries (ctx, options, NULL);
@@ -379,14 +426,13 @@ gst_check_init (int *argc, char **argv[])
       NULL);
   g_log_set_handler (NULL, G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING,
       gst_check_log_critical_func, NULL);
-  g_log_set_handler ("GStreamer", G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING,
-      gst_check_log_critical_func, NULL);
-  g_log_set_handler ("GLib-GObject", G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING,
-      gst_check_log_critical_func, NULL);
-  g_log_set_handler ("GLib-GIO", G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING,
-      gst_check_log_critical_func, NULL);
-  g_log_set_handler ("GLib", G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING,
-      gst_check_log_critical_func, NULL);
+
+  for (i = 0; i < G_N_ELEMENTS (log_domains); ++i) {
+    g_log_set_handler (log_domains[i],
+        G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING,
+        gst_check_log_critical_func, NULL);
+  }
+
   g_test_log_set_fatal_handler (gst_check_log_fatal_func, NULL);
 
   print_plugins ();