info: move some env-var checks from gst to gstinfo as well
authorStefan Sauer <ensonic@users.sf.net>
Thu, 16 Jan 2014 19:11:03 +0000 (20:11 +0100)
committerStefan Sauer <ensonic@users.sf.net>
Thu, 16 Jan 2014 19:47:53 +0000 (20:47 +0100)
We were doing some log related initialisation in gst.c after calling
_priv_gst_debug_init(). Just move it there for consistency.

gst/gst.c
gst/gstinfo.c

index 2ff9eee..17cbcca 100644 (file)
--- a/gst/gst.c
+++ b/gst/gst.c
@@ -471,6 +471,7 @@ init_pre (GOptionContext * context, GOptionGroup * group, gpointer data,
 
 #ifndef GST_DISABLE_GST_DEBUG
   _priv_gst_debug_init ();
+  priv_gst_dump_dot_dir = g_getenv ("GST_DEBUG_DUMP_DOT_DIR");
 #endif
 
 #ifdef ENABLE_NLS
@@ -478,25 +479,6 @@ init_pre (GOptionContext * context, GOptionGroup * group, gpointer data,
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 #endif /* ENABLE_NLS */
 
-#ifndef GST_DISABLE_GST_DEBUG
-  {
-    const gchar *debug_list;
-    const gchar *color_mode;
-
-    if (g_getenv ("GST_DEBUG_NO_COLOR") != NULL)
-      gst_debug_set_color_mode (GST_DEBUG_COLOR_MODE_OFF);
-    color_mode = g_getenv ("GST_DEBUG_COLOR_MODE");
-    if (color_mode)
-      gst_debug_set_color_mode_from_string (color_mode);
-
-    debug_list = g_getenv ("GST_DEBUG");
-    if (debug_list) {
-      gst_debug_set_threshold_from_string (debug_list, FALSE);
-    }
-  }
-
-  priv_gst_dump_dot_dir = g_getenv ("GST_DEBUG_DUMP_DOT_DIR");
-#endif
   /* This is the earliest we can make stuff show up in the logs.
    * So give some useful info about GStreamer here */
   GST_INFO ("Initializing GStreamer Core Library version %s", VERSION);
index c1f17f6..54d7a6c 100644 (file)
@@ -409,6 +409,17 @@ _priv_gst_debug_init (void)
     else if (strstr (env, "pretty_tags") || strstr (env, "pretty-tags"))
       pretty_tags = TRUE;
   }
+
+  if (g_getenv ("GST_DEBUG_NO_COLOR") != NULL)
+    gst_debug_set_color_mode (GST_DEBUG_COLOR_MODE_OFF);
+  env = g_getenv ("GST_DEBUG_COLOR_MODE");
+  if (env)
+    gst_debug_set_color_mode_from_string (env);
+
+  env = g_getenv ("GST_DEBUG");
+  if (env) {
+    gst_debug_set_threshold_from_string (env, FALSE);
+  }
 }
 
 /* we can't do this further above, because we initialize the GST_CAT_DEFAULT struct */