#include "champlain-cache.h"
+#define DEBUG_FLAG CHAMPLAIN_DEBUG_CACHE
+#include "champlain-debug.h"
#include "champlain-enum-types.h"
#include "champlain-private.h"
error = sqlite3_close (priv->data);
if (error != SQLITE_OK)
- g_warning ("Sqlite returned error %d when closing cache.db", error);
+ DEBUG ("Sqlite returned error %d when closing cache.db", error);
G_OBJECT_CLASS (champlain_cache_parent_class)->dispose (object);
}
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
if (error != SQLITE_OK)
{
- g_warning ("Sqlite returned error %d when opening cache.db", error);
+ DEBUG ("Sqlite returned error %d when opening cache.db", error);
goto cleanup;
}
sqlite3_exec (priv->data, "CREATE TABLE etags (filename char(500) PRIMARY KEY, etag char (30))", NULL, NULL, &error_msg);
if (error_msg != NULL)
{
- g_warning ("Creating table Etag failed: %s", error_msg);
+ DEBUG ("Creating table Etag failed: %s", error_msg);
sqlite3_free (error_msg);
goto cleanup;
}
sqlite3_exec (priv->data, query, set_etag, tile, &error_msg);
if (error_msg != NULL)
{
- g_warning ("Retrieving Etag failed: %s", error_msg);
+ DEBUG ("Retrieving Etag failed: %s", error_msg);
sqlite3_free (error_msg);
}
sqlite3_exec (priv->data, query, NULL, NULL, &error);
if (error != NULL)
{
- g_warning ("Saving Etag failed: %s", error);
+ DEBUG ("Saving Etag failed: %s", error);
sqlite3_free (error);
}
{ "Engine", CHAMPLAIN_DEBUG_ENGINE },
{ "View", CHAMPLAIN_DEBUG_VIEW },
{ "Network", CHAMPLAIN_DEBUG_NETWORK },
+ { "Cache", CHAMPLAIN_DEBUG_CACHE },
{ "Other", CHAMPLAIN_DEBUG_OTHER },
{ 0, }
};
CHAMPLAIN_DEBUG_ENGINE = 1 << 2,
CHAMPLAIN_DEBUG_VIEW = 1 << 3,
CHAMPLAIN_DEBUG_NETWORK = 1 << 4,
- CHAMPLAIN_DEBUG_OTHER = 1 << 5,
+ CHAMPLAIN_DEBUG_CACHE = 1 << 5,
+ CHAMPLAIN_DEBUG_OTHER = 1 << 6,
} ChamplainDebugFlags;
gboolean champlain_debug_flag_is_set (ChamplainDebugFlags flag);