Commit cbd18994 authored by Philippe Rouquier's avatar Philippe Rouquier

Drop g_logv to display debug output as when included in some apps this would be filtered

Also add a GConf bool for nautilus extension to print debug output when it is TRUE
parent 303932d4
......@@ -33,6 +33,7 @@
#endif
#include <string.h>
#include <stdio.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
......@@ -53,6 +54,12 @@ static const GOptionEntry options [] = {
{ NULL }
};
void
brasero_burn_library_set_debug (gboolean value)
{
debug = value;
}
/**
* brasero_burn_library_get_option_group:
*
......@@ -94,15 +101,12 @@ brasero_burn_debug_message (const gchar *location,
if (!debug)
return;
format_real = g_strdup_printf ("At %s: %s",
format_real = g_strdup_printf ("BraseroBurn: (at %s) %s\n",
location,
format);
va_start (arg_list, format);
g_logv (BRASERO_BURN_LOG_DOMAIN,
G_LOG_LEVEL_DEBUG,
format_real,
arg_list);
vprintf (format_real, arg_list);
va_end (arg_list);
g_free (format_real);
......@@ -118,15 +122,11 @@ brasero_burn_debug_messagev (const gchar *location,
if (!debug)
return;
format_real = g_strdup_printf ("At %s: %s",
format_real = g_strdup_printf ("BraseroBurn: (at %s) %s\n",
location,
format);
g_logv (BRASERO_BURN_LOG_DOMAIN,
G_LOG_LEVEL_DEBUG,
format_real,
arg_list);
vprintf (format_real, arg_list);
g_free (format_real);
}
......@@ -179,16 +179,13 @@ brasero_burn_debug_flags_type_message (BraseroBurnFlag flags,
brasero_debug_burn_flags_to_string (buffer, flags);
format_real = g_strdup_printf ("At %s: %s %s",
format_real = g_strdup_printf ("BraseroBurn: (at %s) %s %s\n",
location,
format,
buffer);
va_start (arg_list, format);
g_logv (BRASERO_BURN_LOG_DOMAIN,
G_LOG_LEVEL_DEBUG,
format_real,
arg_list);
vprintf (format_real, arg_list);
va_end (arg_list);
g_free (format_real);
......@@ -317,16 +314,13 @@ brasero_burn_debug_track_type_struct_message (BraseroTrackType *type,
else
strcpy (buffer, "Undefined");
format_real = g_strdup_printf ("At %s: %s %s",
format_real = g_strdup_printf ("BraseroBurn: (at %s) %s %s\n",
location,
format,
buffer);
va_start (arg_list, format);
g_logv (BRASERO_BURN_LOG_DOMAIN,
G_LOG_LEVEL_DEBUG,
format_real,
arg_list);
vprintf (format_real, arg_list);
va_end (arg_list);
g_free (format_real);
......@@ -387,16 +381,13 @@ brasero_burn_debug_track_type_message (BraseroTrackDataType type,
break;
}
format_real = g_strdup_printf ("At %s: %s %s",
format_real = g_strdup_printf ("BraseroBurn: (at %s) %s %s\n",
location,
format,
buffer);
va_start (arg_list, format);
g_logv (BRASERO_BURN_LOG_DOMAIN,
G_LOG_LEVEL_DEBUG,
format_real,
arg_list);
vprintf (format_real, arg_list);
va_end (arg_list);
g_free (format_real);
......
......@@ -41,8 +41,6 @@
G_BEGIN_DECLS
#define BRASERO_BURN_LOG_DOMAIN "BraseroBurn"
#define BRASERO_BURN_LOG(format, ...) \
brasero_burn_debug_message (G_STRLOC, \
format, \
......@@ -88,6 +86,9 @@ G_BEGIN_DECLS
format, \
##__VA_ARGS__);
void
brasero_burn_library_set_debug (gboolean value);
void
brasero_burn_debug_setup_module (GModule *handle);
......
......@@ -49,6 +49,9 @@ brasero_media_get_all_list (BraseroMedia type);
* For internal debugging purposes
*/
void
brasero_media_library_set_debug (gboolean value);
void
brasero_media_to_string (BraseroMedia media,
gchar *string);
......
......@@ -33,6 +33,7 @@
#endif
#include <string.h>
#include <stdio.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
......@@ -55,6 +56,12 @@ static const GOptionEntry options [] = {
{ NULL }
};
void
brasero_media_library_set_debug (gboolean value)
{
debug = value;
}
static GSList *
brasero_media_add_to_list (GSList *retval,
BraseroMedia media)
......@@ -452,8 +459,6 @@ brasero_media_to_string (BraseroMedia media,
strcat (buffer, "Unformatted ");
}
#define BRASERO_MEDIA_LOG_DOMAIN "BraseroMedia"
/**
* brasero_media_get_option_group:
*
......@@ -488,15 +493,12 @@ brasero_media_message (const gchar *location,
if (!debug)
return;
format_real = g_strdup_printf ("At %s: %s",
format_real = g_strdup_printf ("BraseroMedia: (at %s) %s\n",
location,
format);
va_start (arg_list, format);
g_logv (BRASERO_MEDIA_LOG_DOMAIN,
G_LOG_LEVEL_DEBUG,
format_real,
arg_list);
vprintf (format_real, arg_list);
va_end (arg_list);
g_free (format_real);
......
......@@ -9,6 +9,7 @@ INCLUDES = \
-I$(top_builddir)/libbrasero-burn/ \
-I$(top_srcdir)/src/ \
-I$(top_builddir)/src/ \
$(BRASERO_GCONF_CFLAGS) \
$(NAUTILUS_EXTENSION_CFLAGS) \
$(WARN_CFLAGS) \
$(WERROR) \
......@@ -48,6 +49,7 @@ libnautilus_brasero_extension_la_SOURCES = \
../src/brasero-project-name.h
libnautilus_brasero_extension_la_LIBADD = \
$(BRASERO_GCONF_CFLAGS) \
$(NAUTILUS_EXTENSION_LIBS) \
../libbrasero-utils/libbrasero-utils.la \
../libbrasero-media/libbrasero-media.la \
......
......@@ -29,6 +29,9 @@
#include <glib/gi18n-lib.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#include <gconf/gconf-client.h>
#include <libnautilus-extension/nautilus-menu-provider.h>
#include <libnautilus-extension/nautilus-location-widget-provider.h>
......@@ -58,6 +61,9 @@
#include "brasero-misc.h"
#include "brasero-media-private.h"
#include "burn-debug.h"
#define BURN_URI "burn:///"
#define NAUTILUS_TYPE_DISC_BURN (nautilus_disc_burn_get_type ())
......@@ -959,10 +965,20 @@ nautilus_disc_burn_register_type (GTypeModule *module)
void
nautilus_module_initialize (GTypeModule *module)
{
GConfClient *client;
DEBUG_PRINT ("Initializing nautilus-disc-recorder\n");
brasero_media_library_start ();
client = gconf_client_get_default ();
if (gconf_client_get_bool (client, "/apps/brasero/nautilus-extension-debug", NULL)) {
brasero_media_library_set_debug (TRUE);
brasero_burn_library_set_debug (TRUE);
}
g_object_unref (client);
brasero_media_library_start ();
brasero_burn_library_start (NULL, NULL);
DEBUG_PRINT ("Libbrasero-media started\n");
nautilus_disc_burn_register_type (module);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment