Author: abrander
Date: 2013-03-31 14:18:30 +0200 (Sun, 31 Mar 2013)
New Revision: 4344
Modified:
trunk/librawstudio/rs-debug.c
trunk/librawstudio/rs-debug.h
trunk/librawstudio/rs-library.c
Log:
Ported library debug printing to BB_DEBUG().
Modified: trunk/librawstudio/rs-debug.c
===================================================================
--- trunk/librawstudio/rs-debug.c 2013-03-31 11:20:05 UTC (rev 4343)
+++ trunk/librawstudio/rs-debug.c 2013-03-31 12:18:30 UTC (rev 4344)
@@ -26,7 +26,8 @@
{ "plugins", RS_DEBUG_PLUGINS },
{ "filters", RS_DEBUG_FILTERS },
{ "performance", RS_DEBUG_PERFORMANCE },
- { "processing", RS_DEBUG_PROCESSING }
+ { "processing", RS_DEBUG_PROCESSING },
+ { "library", RS_DEBUG_LIBRARY },
};
void
Modified: trunk/librawstudio/rs-debug.h
===================================================================
--- trunk/librawstudio/rs-debug.h 2013-03-31 11:20:05 UTC (rev 4343)
+++ trunk/librawstudio/rs-debug.h 2013-03-31 12:18:30 UTC (rev 4344)
@@ -29,7 +29,8 @@
RS_DEBUG_PLUGINS = 1 << 0,
RS_DEBUG_FILTERS = 1 << 1,
RS_DEBUG_PERFORMANCE = 1 << 2,
- RS_DEBUG_PROCESSING = 1 << 3
+ RS_DEBUG_PROCESSING = 1 << 3,
+ RS_DEBUG_LIBRARY = 1 << 4,
} RSDebugFlag;
#define RS_DEBUG(type,x,a...) \
@@ -47,4 +48,4 @@
G_END_DECLS
-#endif /* RS_DEBUG_H */
\ No newline at end of file
+#endif /* RS_DEBUG_H */
Modified: trunk/librawstudio/rs-library.c
===================================================================
--- trunk/librawstudio/rs-library.c 2013-03-31 11:20:05 UTC (rev 4343)
+++ trunk/librawstudio/rs-library.c 2013-03-31 12:18:30 UTC (rev 4344)
@@ -56,6 +56,7 @@
#include "conf_interface.h"
#include "config.h"
#include "gettext.h"
+#include "rs-debug.h"
#include <libxml/encoding.h>
#include <libxml/xmlwriter.h>
#include <sqlite3.h>
@@ -236,12 +237,12 @@
default:
/* We should never hit this */
- g_debug("Some error occured in library_check_version()
- please notify developers");
+ g_warning("Some error occured in
library_check_version() - please notify developers");
break;
}
version++;
- g_debug("Updated library database to version %d", version);
+ RS_DEBUG(LIBRARY, "Updated library database to version %d",
version);
}
}
@@ -256,7 +257,7 @@
if(sqlite3_open(database, &(library->db)))
{
gchar *msg = g_strdup_printf(_("Could not open database %s"),
database);
- g_debug("sqlite3 debug: %s\n", msg);
+ g_warning("sqlite3: %s\n", msg);
if (library->error_init)
g_free(library->error_init);
library->error_init = g_strdup(msg);
@@ -605,7 +606,7 @@
photo_id = library_find_photo_id(library, filename);
if (photo_id == -1)
{
- g_debug("Adding photo to library: %s",filename);
+ RS_DEBUG(LIBRARY, "Adding photo to library: %s",filename);
photo_id = library_add_photo(library, filename);
}
@@ -625,7 +626,7 @@
tag_id = library_find_tag_id(library, tagname);
if (tag_id == -1)
{
- g_debug("Adding tag to tags: %s",tagname);
+ RS_DEBUG(LIBRARY, "Adding tag to tags: %s",tagname);
tag_id = library_add_tag(library, tagname);
}
@@ -794,7 +795,7 @@
sqlite3_finalize(stmt);
library_sqlite_error(db, rc);
- g_debug("Search in library took %.03f seconds", g_timer_elapsed(gt,
NULL));
+ RS_DEBUG(LIBRARY, "Search in library took %.03f seconds",
g_timer_elapsed(gt, NULL));
g_timer_destroy(gt);
return photos;
_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit