From: Stefan Sauer Date: Thu, 16 Jan 2014 19:11:03 +0000 (+0100) Subject: info: move some env-var checks from gst to gstinfo as well X-Git-Tag: 1.3.1~208 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0264bbdb46526ef08e3bc8e5c1b93d2142c9aa7f;p=platform%2Fupstream%2Fgstreamer.git info: move some env-var checks from gst to gstinfo as well We were doing some log related initialisation in gst.c after calling _priv_gst_debug_init(). Just move it there for consistency. --- diff --git a/gst/gst.c b/gst/gst.c index 2ff9eee..17cbcca 100644 --- 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); diff --git a/gst/gstinfo.c b/gst/gstinfo.c index c1f17f6..54d7a6c 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -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 */