[Xfce4-commits] [apps/xfdashboard] 01/01: Add fine-grained controllable debug system

noreply at xfce.org noreply at xfce.org
Wed Mar 22 18:34:43 CET 2017


This is an automated email from the git hooks/post-receive script.

nomad pushed a commit to branch master
in repository apps/xfdashboard.

commit 94f19189ddec10e6fe73b7bf6cbc40a6a7cbc5fa
Author: Stephan Haller <nomad at froevel.de>
Date:   Wed Mar 22 18:31:45 2017 +0100

    Add fine-grained controllable debug system
    
    If debug is enabled in configure script the user can use the environment variable XFDASHBOARD_DEBUG to enable categories to debug. But also classes like XfdashboardActor can be set in this environment variable to debug a specific class. Classes are case-sensitive and must be in camel-case. You can mix categories and classes in enviroment variable. You can set multiple categories and/or classes to debug by separating them by commas.
---
 configure.ac.in                               |  22 +++
 libxfdashboard/Makefile.am                    |   3 +
 libxfdashboard/action-button.c                |  21 +--
 libxfdashboard/actor.c                        |  55 +++++--
 libxfdashboard/application-database.c         | 204 ++++++++++++++++----------
 libxfdashboard/application-tracker.c          | 158 +++++++++++---------
 libxfdashboard/application.c                  |  66 ++++++++-
 libxfdashboard/applications-menu-model.c      |   9 +-
 libxfdashboard/applications-search-provider.c |  32 ++--
 libxfdashboard/applications-view.c            |  43 +++---
 libxfdashboard/binding.c                      |   5 +-
 libxfdashboard/bindings-pool.c                |  45 ++++--
 libxfdashboard/compat.h                       |  15 ++
 libxfdashboard/css-selector.c                 |   9 +-
 libxfdashboard/debug.c                        |  72 +++++++++
 libxfdashboard/debug.h                        | 119 +++++++++++++++
 libxfdashboard/desktop-app-info.c             |  11 +-
 libxfdashboard/emblem-effect.c                |  13 +-
 libxfdashboard/focus-manager.c                |  69 +++++----
 libxfdashboard/focusable.c                    |  23 ++-
 libxfdashboard/image-content.c                | 144 +++++++++++++-----
 libxfdashboard/live-workspace.c               |  16 +-
 libxfdashboard/plugin.c                       |  38 +++--
 libxfdashboard/plugins-manager.c              |  58 ++++++--
 libxfdashboard/popup-menu.c                   |  30 ++--
 libxfdashboard/quicklaunch.c                  | 156 +++++++++++---------
 libxfdashboard/scrollbar.c                    |  23 ++-
 libxfdashboard/search-manager.c               |  15 +-
 libxfdashboard/search-provider.c              |   8 +-
 libxfdashboard/search-result-container.c      |  51 ++++---
 libxfdashboard/search-view.c                  |  91 +++++++-----
 libxfdashboard/stage-interface.c              |  19 ++-
 libxfdashboard/stage.c                        |  44 +++---
 libxfdashboard/theme-css.c                    | 119 +++++++++------
 libxfdashboard/theme-effects.c                |  27 ++--
 libxfdashboard/theme-layout.c                 | 152 ++++++++++++-------
 libxfdashboard/theme.c                        |  17 ++-
 libxfdashboard/utils.c                        |  14 +-
 libxfdashboard/view-manager.c                 |  15 +-
 libxfdashboard/viewpad.c                      |  35 +++--
 libxfdashboard/window-content.c               | 189 +++++++++++++++---------
 libxfdashboard/window-tracker-monitor.c       |  19 ++-
 libxfdashboard/window-tracker-window.c        |  86 +++++++----
 libxfdashboard/window-tracker.c               | 148 +++++++++++++------
 libxfdashboard/windows-view.c                 |  81 +++++-----
 libxfdashboard/workspace-selector.c           |  28 ++--
 46 files changed, 1766 insertions(+), 851 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 08c87e3..e540ab9 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -225,6 +225,23 @@ dnl *** Check for debugging support ***
 dnl ***********************************
 XDT_FEATURE_DEBUG([xfdashboard_debug_default])
 
+AS_CASE([$enable_debug],
+	[full],
+	[XFDASHBOARD_DEBUG_CFLAGS="-DXFDASHBOARD_ENABLE_DEBUG"],
+
+	[yes],
+	[XFDASHBOARD_DEBUG_CFLAGS="-DXFDASHBOARD_ENABLE_DEBUG"],
+
+	[minimum],
+	[XFDASHBOARD_DEBUG_CFLAGS="-DG_DISABLE_CAST_CHECKS"],
+
+	[no],
+	[XFDASHBOARD_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"],
+
+	[AC_MSG_ERROR([Unknown argument for --enable-debug])]
+)
+AC_SUBST(XFDASHBOARD_DEBUG_CFLAGS)
+
 dnl **************************************
 dnl *** Check for linker optimizations ***
 dnl **************************************
@@ -293,6 +310,11 @@ echo "  Version:          $VERSION"
 echo "  Revision:         $REVISION"
 echo "  Library version:  $LIBXFDASHBOARD_VERINFO"
 echo
+echo "Compiler options:"
+echo "  Compiler flags:   $CFLAGS $MAINTAINER_CFLAGS"
+echo "  Debug level:      $enable_debug"
+echo "  Debug flags:      $XFDASHBOARD_DEBUG_CFLAGS"
+echo
 echo "Library versions used:"
 echo "  libwnck:          $LIBWNCK_VERSION"
 echo "  clutter:          $CLUTTER_VERSION"
diff --git a/libxfdashboard/Makefile.am b/libxfdashboard/Makefile.am
index ac89ae3..fb7b81b 100644
--- a/libxfdashboard/Makefile.am
+++ b/libxfdashboard/Makefile.am
@@ -5,6 +5,7 @@ AM_CPPFLAGS = \
 	-DPACKAGE_DATADIR=\"$(datadir)\" \
 	-DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
 	-DPACKAGE_LIBDIR=\"$(libdir)\" \
+	$(XFDASHBOARD_DEBUG_CFLAGS) \
 	$(PLATFORM_CPPFLAGS)
 
 pkgconfigdir = $(libdir)/pkgconfig
@@ -41,6 +42,7 @@ libxfdashboard_la_headers = \
 	collapse-box.h \
 	compat.h \
 	css-selector.h \
+	debug.h \
 	desktop-app-info.h \
 	drag-action.h \
 	drop-action.h \
@@ -114,6 +116,7 @@ libxfdashboard_la_SOURCES = \
 	click-action.c \
 	collapse-box.c \
 	css-selector.c \
+	debug.c \
 	desktop-app-info.c \
 	drag-action.c \
 	drop-action.c \
diff --git a/libxfdashboard/action-button.c b/libxfdashboard/action-button.c
index e75c32f..be6c4f1 100644
--- a/libxfdashboard/action-button.c
+++ b/libxfdashboard/action-button.c
@@ -59,6 +59,7 @@
 #include <libxfdashboard/focusable.h>
 #include <libxfdashboard/focus-manager.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -115,9 +116,9 @@ static void _xfdashboard_action_button_clicked(XfdashboardButton *inButton)
 
 	/* Get target object to perform action at */
 	targets=xfdashboard_focus_manager_get_targets(priv->focusManager, priv->target);
-	g_debug("Target list for '%s' has %d entries",
-				priv->target,
-				g_slist_length(targets));
+	XFDASHBOARD_DEBUG(self, ACTOR, "Target list for '%s' has %d entries",
+						priv->target,
+						g_slist_length(targets));
 
 	/* Emit action at each actor in target list */
 	for(iter=targets; iter; iter=g_slist_next(iter))
@@ -199,9 +200,9 @@ static void _xfdashboard_action_button_clicked(XfdashboardButton *inButton)
 		}
 
 		/* Emit action signal at target */
-		g_debug("Emitting action signal '%s' at actor %s",
-					priv->action,
-					G_OBJECT_TYPE_NAME(targetObject));
+		XFDASHBOARD_DEBUG(self, ACTOR, "Emitting action signal '%s' at actor %s",
+							priv->action,
+							G_OBJECT_TYPE_NAME(targetObject));
 
 		event=clutter_get_current_event();
 		eventStatus=CLUTTER_EVENT_PROPAGATE;
@@ -212,10 +213,10 @@ static void _xfdashboard_action_button_clicked(XfdashboardButton *inButton)
 								event,
 								&eventStatus);
 
-		g_debug("Action signal '%s' was %s by actor %s",
-					priv->action,
-					eventStatus==CLUTTER_EVENT_STOP ? "handled" : "not handled",
-					G_OBJECT_TYPE_NAME(targetObject));
+		XFDASHBOARD_DEBUG(self, ACTOR, "Action signal '%s' was %s by actor %s",
+							priv->action,
+							eventStatus==CLUTTER_EVENT_STOP ? "handled" : "not handled",
+							G_OBJECT_TYPE_NAME(targetObject));
 	}
 
 	/* Release allocated resources */
diff --git a/libxfdashboard/actor.c b/libxfdashboard/actor.c
index f0af859..61205a2 100644
--- a/libxfdashboard/actor.c
+++ b/libxfdashboard/actor.c
@@ -34,6 +34,7 @@
 #include <libxfdashboard/focusable.h>
 #include <libxfdashboard/utils.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -505,7 +506,12 @@ static void _xfdashboard_actor_stylable_invalidate(XfdashboardStylable *inStylab
 		gchar					*defaultsValStr;
 		GParamSpec				*realParamSpec;
 
-		g_debug("Got param specs for %p (%s) with class '%s' and pseudo-class '%s'", self, G_OBJECT_TYPE_NAME(self), priv->styleClasses, priv->stylePseudoClasses);
+		XFDASHBOARD_DEBUG(self, STYLE,
+							"Got param specs for %p (%s) with class '%s' and pseudo-class '%s'",
+							self,
+							G_OBJECT_TYPE_NAME(self),
+							priv->styleClasses,
+							priv->stylePseudoClasses);
 
 		g_hash_table_iter_init(&hashIter, possibleStyleSet);
 		while(g_hash_table_iter_next(&hashIter, (gpointer*)&defaultsKey, (gpointer*)&paramSpec))
@@ -516,13 +522,18 @@ static void _xfdashboard_actor_stylable_invalidate(XfdashboardStylable *inStylab
 			g_param_value_set_default(realParamSpec, &defaultsVal);
 
 			defaultsValStr=g_strdup_value_contents(&defaultsVal);
-			g_debug("%d: param spec [%s] %s=%s\n", ++i, G_OBJECT_CLASS_NAME(klass), defaultsKey, defaultsValStr);
+			XFDASHBOARD_DEBUG(self, STYLE,
+								"%d: param spec [%s] %s=%s\n",
+								++i,
+								G_OBJECT_CLASS_NAME(klass),
+								defaultsKey,
+								defaultsValStr);
 			g_free(defaultsValStr);
 
 			g_value_unset(&defaultsVal);
 		}
 
-		g_debug("End of param specs");
+		XFDASHBOARD_DEBUG(self, STYLE, "End of param specs");
 	}
 #endif
 
@@ -534,15 +545,25 @@ static void _xfdashboard_actor_stylable_invalidate(XfdashboardStylable *inStylab
 	{
 		gint					i=0;
 
-		g_debug("Got styles from theme for %p (%s) with class '%s' and pseudo-class '%s'", self, G_OBJECT_TYPE_NAME(self), priv->styleClasses, priv->stylePseudoClasses);
+		XFDASHBOARD_DEBUG(self, STYLE,
+							"Got styles from theme for %p (%s) with class '%s' and pseudo-class '%s'",
+							self,
+							G_OBJECT_TYPE_NAME(self),
+							priv->styleClasses,
+							priv->stylePseudoClasses);
 
 		g_hash_table_iter_init(&hashIter, themeStyleSet);
 		while(g_hash_table_iter_next(&hashIter, (gpointer*)&styleName, (gpointer*)&styleValue))
 		{
-			g_debug("%d: [%s] %s=%s\n", ++i, styleValue->source, (gchar*)styleName, styleValue->string);
+			XFDASHBOARD_DEBUG(self, STYLE,
+								"%d: [%s] %s=%s\n",
+								++i,
+								styleValue->source,
+								(gchar*)styleName,
+								styleValue->string);
 		}
 
-		g_debug("End of styles from theme");
+		XFDASHBOARD_DEBUG(self, STYLE, "End of styles from theme");
 	}
 #endif
 
@@ -589,7 +610,11 @@ static void _xfdashboard_actor_stylable_invalidate(XfdashboardStylable *inStylab
 				gchar					*valstr;
 
 				valstr=g_strdup_value_contents(&propertyValue);
-				g_debug("Setting theme value of style property [%s] %s=%s\n", G_OBJECT_CLASS_NAME(klass), styleName, valstr);
+				XFDASHBOARD_DEBUG(self, STYLE,
+									"Setting theme value of style property [%s] %s=%s\n",
+									G_OBJECT_CLASS_NAME(klass),
+									styleName,
+									valstr);
 				g_free(valstr);
 			}
 #endif
@@ -645,7 +670,11 @@ static void _xfdashboard_actor_stylable_invalidate(XfdashboardStylable *inStylab
 				gchar					*valstr;
 
 				valstr=g_strdup_value_contents(&propertyValue);
-				g_debug("Restoring default value of style property [%s] %s=%s\n", G_OBJECT_CLASS_NAME(klass), styleName, valstr);
+				XFDASHBOARD_DEBUG(self, STYLE,
+									"Restoring default value of style property [%s] %s=%s\n",
+									G_OBJECT_CLASS_NAME(klass),
+									styleName,
+									valstr);
 				g_free(valstr);
 			}
 #endif
@@ -1043,8 +1072,9 @@ void xfdashboard_actor_base_class_finalize(XfdashboardActorClass *klass)
 		{
 			g_param_spec_pool_remove(_xfdashboard_actor_stylable_properties_pool, paramSpec);
 
-			g_debug("Unregistered stylable property named '%s' for class '%s'",
-					g_param_spec_get_name(paramSpec), G_OBJECT_CLASS_NAME(klass));
+			XFDASHBOARD_DEBUG(NULL, STYLE,
+								"Unregistered stylable property named '%s' for class '%s'",
+								g_param_spec_get_name(paramSpec), G_OBJECT_CLASS_NAME(klass));
 
 			g_param_spec_unref(paramSpec);
 		}
@@ -1202,8 +1232,9 @@ void xfdashboard_actor_install_stylable_property(XfdashboardActorClass *klass, G
 									g_param_spec_ref(inParamSpec),
 									(GDestroyNotify)g_param_spec_unref);
 	g_param_spec_pool_insert(_xfdashboard_actor_stylable_properties_pool, stylableParamSpec, G_OBJECT_CLASS_TYPE(klass));
-	g_debug("Registered stylable property '%s' for class '%s'",
-				g_param_spec_get_name(inParamSpec), G_OBJECT_CLASS_NAME(klass));
+	XFDASHBOARD_DEBUG(NULL, STYLE,
+						"Registered stylable property '%s' for class '%s'",
+						g_param_spec_get_name(inParamSpec), G_OBJECT_CLASS_NAME(klass));
 }
 
 void xfdashboard_actor_install_stylable_property_by_name(XfdashboardActorClass *klass, const gchar *inParamName)
diff --git a/libxfdashboard/application-database.c b/libxfdashboard/application-database.c
index 38b02e7..a08fb18 100644
--- a/libxfdashboard/application-database.c
+++ b/libxfdashboard/application-database.c
@@ -31,6 +31,7 @@
 #include <libxfdashboard/application-database.h>
 #include <libxfdashboard/desktop-app-info.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -127,7 +128,9 @@ static void _xfdashboard_application_database_on_application_menu_reload_require
 	error=NULL;
 
 	/* Reload application menu. This also emits all necessary signals. */
-	g_debug("%s: Menu '%s' changed and requires a reload of application menu", __func__, garcon_menu_element_get_name(GARCON_MENU_ELEMENT(menu)));
+	XFDASHBOARD_DEBUG(self, APPLICATIONS,
+						"Menu '%s' changed and requires a reload of application menu",
+						garcon_menu_element_get_name(GARCON_MENU_ELEMENT(menu)));
 	if(!_xfdashboard_application_database_load_application_menu(self, &error))
 	{
 		g_critical(_("Could not reload application menu: %s"),
@@ -279,7 +282,9 @@ static void _xfdashboard_application_database_on_file_monitor_changed(Xfdashboar
 
 		error=NULL;
 
-		g_debug("Directory '%s' in application search paths was created", filePath);
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Directory '%s' in application search paths was created",
+							filePath);
 
 		/* A new directory was created so create a file monitor for it,
 		 * connect signals and add to list of registered file monitors.
@@ -329,7 +334,9 @@ static void _xfdashboard_application_database_on_file_monitor_changed(Xfdashboar
 		{
 			gchar										*desktopID;
 
-			g_debug("Desktop file '%s' in application search paths was created", filePath);
+			XFDASHBOARD_DEBUG(self, APPLICATIONS,
+								"Desktop file '%s' in application search paths was created",
+								filePath);
 
 			/* Get desktop ID to check */
 			desktopID=xfdashboard_application_database_get_desktop_id_from_file(inFile);
@@ -365,16 +372,18 @@ static void _xfdashboard_application_database_on_file_monitor_changed(Xfdashboar
 						 */
 						g_object_set(currentDesktopAppInfo, "file", newDesktopFile, NULL);
 
-						g_debug("Replacing known desktop ID '%s' at desktop file '%s' with new desktop file '%s'",
-									desktopID,
-									filePath,
-									newDesktopFilename);
+						XFDASHBOARD_DEBUG(self, APPLICATIONS,
+											"Replacing known desktop ID '%s' at desktop file '%s' with new desktop file '%s'",
+											desktopID,
+											filePath,
+											newDesktopFilename);
 					}
 						else
 						{
-							g_debug("Ignoring new desktop file at '%s' for known desktop ID '%s'",
-										filePath,
-										desktopID);
+							XFDASHBOARD_DEBUG(self, APPLICATIONS,
+												"Ignoring new desktop file at '%s' for known desktop ID '%s'",
+												filePath,
+												desktopID);
 						}
 
 					/* Release allocated resources */
@@ -405,15 +414,17 @@ static void _xfdashboard_application_database_on_file_monitor_changed(Xfdashboar
 							/* Emit signal that an application has been removed from hash table */
 							g_signal_emit(self, XfdashboardApplicationDatabaseSignals[SIGNAL_APPLICATION_ADDED], 0, newDesktopAppInfo);
 
-							g_debug("Adding new desktop ID '%s' for new desktop file at '%s'",
-										desktopID,
-										filePath);
+							XFDASHBOARD_DEBUG(self, APPLICATIONS,
+												"Adding new desktop ID '%s' for new desktop file at '%s'",
+												desktopID,
+												filePath);
 						}
 							else
 							{
-								g_debug("Adding new desktop ID '%s' for new desktop file '%s' failed",
-											desktopID,
-											filePath);
+								XFDASHBOARD_DEBUG(self, APPLICATIONS,
+													"Adding new desktop ID '%s' for new desktop file '%s' failed",
+													desktopID,
+													filePath);
 
 								/* Release allocated resources */
 								g_object_unref(newDesktopAppInfo);
@@ -436,7 +447,9 @@ static void _xfdashboard_application_database_on_file_monitor_changed(Xfdashboar
 			gchar										*desktopID;
 			XfdashboardDesktopAppInfo					*appInfo;
 
-			g_debug("Desktop file '%s' was modified", filePath);
+			XFDASHBOARD_DEBUG(self, APPLICATIONS,
+								"Desktop file '%s' was modified",
+								filePath);
 
 			/* Get desktop ID to check */
 			desktopID=xfdashboard_application_database_get_desktop_id_from_file(inFile);
@@ -486,10 +499,11 @@ static void _xfdashboard_application_database_on_file_monitor_changed(Xfdashboar
 							 */
 							g_hash_table_remove(priv->applications, desktopID);
 
-							g_debug("Removed desktop ID '%s' with origin desktop file '%s' with modified desktop file '%s' because reload failed or it is invalid",
-										desktopID,
-										filePath,
-										appInfoFilename);
+							XFDASHBOARD_DEBUG(self, APPLICATIONS,
+												"Removed desktop ID '%s' with origin desktop file '%s' with modified desktop file '%s' because reload failed or it is invalid",
+												desktopID,
+												filePath,
+												appInfoFilename);
 
 							/* Emit signal that an application has been removed */
 							g_signal_emit(self, XfdashboardApplicationDatabaseSignals[SIGNAL_APPLICATION_REMOVED], 0, appInfo);
@@ -501,10 +515,11 @@ static void _xfdashboard_application_database_on_file_monitor_changed(Xfdashboar
 						}
 							else
 							{
-								g_debug("Reloaded desktop ID '%s' with origin desktop file '%s' with modified desktop file '%s'",
-											desktopID,
-											filePath,
-											appInfoFilename);
+								XFDASHBOARD_DEBUG(self, APPLICATIONS,
+													"Reloaded desktop ID '%s' with origin desktop file '%s' with modified desktop file '%s'",
+													desktopID,
+													filePath,
+													appInfoFilename);
 							}
 					}
 
@@ -531,15 +546,17 @@ static void _xfdashboard_application_database_on_file_monitor_changed(Xfdashboar
 							/* Emit signal that an application has been removed from hash table */
 							g_signal_emit(self, XfdashboardApplicationDatabaseSignals[SIGNAL_APPLICATION_ADDED], 0, newDesktopAppInfo);
 
-							g_debug("Adding new desktop ID '%s' for modified desktop file at '%s'",
-										desktopID,
-										filePath);
+							XFDASHBOARD_DEBUG(self, APPLICATIONS,
+												"Adding new desktop ID '%s' for modified desktop file at '%s'",
+												desktopID,
+												filePath);
 						}
 							else
 							{
-								g_debug("Got valid desktop id '%s' but invalid desktop app info for file '%s'",
-											desktopID,
-											filePath);
+								XFDASHBOARD_DEBUG(self, APPLICATIONS,
+													"Got valid desktop id '%s' but invalid desktop app info for file '%s'",
+													desktopID,
+													filePath);
 								g_object_unref(newDesktopAppInfo);
 							}
 					}
@@ -566,7 +583,9 @@ static void _xfdashboard_application_database_on_file_monitor_changed(Xfdashboar
 		fileMonitorData=_xfdashboard_application_database_monitor_data_find_by_file(self, inFile);
 		if(fileMonitorData)
 		{
-			g_debug("Removing file monitor for deleted directory '%s'", filePath);
+			XFDASHBOARD_DEBUG(self, APPLICATIONS,
+								"Removing file monitor for deleted directory '%s'",
+								filePath);
 
 			priv->appDirMonitors=g_list_remove_all(priv->appDirMonitors, fileMonitorData);
 			_xfdashboard_application_database_monitor_data_free(fileMonitorData);
@@ -584,7 +603,9 @@ static void _xfdashboard_application_database_on_file_monitor_changed(Xfdashboar
 		{
 			gchar										*desktopID;
 
-			g_debug("Desktop file '%s' was removed", filePath);
+			XFDASHBOARD_DEBUG(self, APPLICATIONS,
+								"Desktop file '%s' was removed",
+								filePath);
 
 			/* Get desktop ID to check */
 			desktopID=xfdashboard_application_database_get_desktop_id_from_file(inFile);
@@ -610,10 +631,11 @@ static void _xfdashboard_application_database_on_file_monitor_changed(Xfdashboar
 					{
 						GFile							*newDesktopFile;
 
-						g_debug("Replacing known desktop ID '%s' at desktop file '%s' with new desktop file '%s'",
-									desktopID,
-									filePath,
-									newDesktopFilename);
+						XFDASHBOARD_DEBUG(self, APPLICATIONS,
+											"Replacing known desktop ID '%s' at desktop file '%s' with new desktop file '%s'",
+											desktopID,
+											filePath,
+											newDesktopFilename);
 
 						/* There is another desktop file which could replace the
 						 * desktop ID. Set new file at desktop app info which causes
@@ -641,7 +663,9 @@ static void _xfdashboard_application_database_on_file_monitor_changed(Xfdashboar
 							 */
 							g_hash_table_remove(priv->applications, desktopID);
 
-							g_debug("Removing desktop ID '%s'", desktopID);
+							XFDASHBOARD_DEBUG(self, APPLICATIONS,
+												"Removing desktop ID '%s'",
+												desktopID);
 
 							/* Emit signal that an application has been removed */
 							g_signal_emit(self, XfdashboardApplicationDatabaseSignals[SIGNAL_APPLICATION_REMOVED], 0, currentDesktopAppInfo);
@@ -695,9 +719,10 @@ static gboolean _xfdashboard_application_database_load_applications_recursive(Xf
 	path=g_file_get_path(inCurrentPath);
 	topLevelPath=g_file_get_path(inTopLevelPath);
 
-	g_debug("Scanning directory '%s' for search path '%s'",
-				path,
-				topLevelPath);
+	XFDASHBOARD_DEBUG(self, APPLICATIONS,
+						"Scanning directory '%s' for search path '%s'",
+						path,
+						topLevelPath);
 
 	/* Create enumerator for current path to iterate through path and
 	 * searching for desktop files.
@@ -733,18 +758,20 @@ static gboolean _xfdashboard_application_database_load_applications_recursive(Xf
 			GFile							*childPath;
 			gboolean						childSuccess;
 
-			g_debug("Suspend scanning directory '%s' at search path '%s' for sub-directory '%s'",
-						path,
-						topLevelPath,
-						g_file_info_get_name(info));
+			XFDASHBOARD_DEBUG(self, APPLICATIONS,
+								"Suspend scanning directory '%s' at search path '%s' for sub-directory '%s'",
+								path,
+								topLevelPath,
+								g_file_info_get_name(info));
 
 			childPath=g_file_resolve_relative_path(inCurrentPath,
 													g_file_info_get_name(info));
 			if(!childPath)
 			{
-				g_debug("Unable to build path to search for desktop files for path='%s' and file='%s'",
-						path,
-						g_file_info_get_name(info));
+				XFDASHBOARD_DEBUG(self, APPLICATIONS,
+									"Unable to build path to search for desktop files for path='%s' and file='%s'",
+									path,
+									g_file_info_get_name(info));
 
 				/* Set error */
 				g_set_error(outError,
@@ -771,10 +798,11 @@ static gboolean _xfdashboard_application_database_load_applications_recursive(Xf
 																						&error);
 			if(!childSuccess)
 			{
-				g_debug("Unable to iterate desktop files at %s%s%s",
-						path,
-						G_DIR_SEPARATOR_S,
-						g_file_info_get_name(info));
+				XFDASHBOARD_DEBUG(self, APPLICATIONS,
+									"Unable to iterate desktop files at %s%s%s",
+									path,
+									G_DIR_SEPARATOR_S,
+									g_file_info_get_name(info));
 
 				/* Propagate error */
 				g_propagate_error(outError, error);
@@ -791,9 +819,10 @@ static gboolean _xfdashboard_application_database_load_applications_recursive(Xf
 			/* Release allocated resources */
 			if(childPath) g_object_unref(childPath);
 
-			g_debug("Resume scanning directory '%s' at search path '%s'",
-						path,
-						topLevelPath);
+			XFDASHBOARD_DEBUG(self, APPLICATIONS,
+								"Resume scanning directory '%s' at search path '%s'",
+								path,
+								topLevelPath);
 		}
 
 		/* If current file is a regular file and if it is a desktop file
@@ -852,21 +881,23 @@ static gboolean _xfdashboard_application_database_load_applications_recursive(Xf
 				{
 					g_hash_table_insert(*ioDesktopAppInfos, g_strdup(desktopID), g_object_ref(appInfo));
 
-					g_debug("Found desktop file '%s%s%s' with desktop ID '%s' at search path '%s'",
-								path,
-								G_DIR_SEPARATOR_S,
-								childName,
-								desktopID,
-								topLevelPath);
+					XFDASHBOARD_DEBUG(self, APPLICATIONS,
+										"Found desktop file '%s%s%s' with desktop ID '%s' at search path '%s'",
+										path,
+										G_DIR_SEPARATOR_S,
+										childName,
+										desktopID,
+										topLevelPath);
 				}
 					else
 					{
-						g_debug("Not adding invalid desktop file '%s%s%s' with desktop ID '%s' at search path '%s'",
-									path,
-									G_DIR_SEPARATOR_S,
-									childName,
-									desktopID,
-									topLevelPath);
+						XFDASHBOARD_DEBUG(self, APPLICATIONS,
+											"Not adding invalid desktop file '%s%s%s' with desktop ID '%s' at search path '%s'",
+											path,
+											G_DIR_SEPARATOR_S,
+											childName,
+											desktopID,
+											topLevelPath);
 					}
 
 				g_object_unref(appInfo);
@@ -899,7 +930,9 @@ static gboolean _xfdashboard_application_database_load_applications_recursive(Xf
 	monitorData=_xfdashboard_application_database_monitor_data_new(inCurrentPath);
 	if(!monitorData)
 	{
-		g_debug("Failed to create data object for file monitor for path '%s'", path);
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Failed to create data object for file monitor for path '%s'",
+							path);
 
 		/* Set error */
 		g_set_error(outError,
@@ -928,7 +961,9 @@ static gboolean _xfdashboard_application_database_load_applications_recursive(Xf
 		/* Clear error as this error will not fail at FreeBSD */
 		g_clear_error(&error);
 #else
-		g_debug("Failed to initialize file monitor for path '%s'", path);
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Failed to initialize file monitor for path '%s'",
+							path);
 
 		/* Propagate error */
 		g_propagate_error(outError, error);
@@ -949,19 +984,24 @@ static gboolean _xfdashboard_application_database_load_applications_recursive(Xf
 	{
 		*ioFileMonitors=g_list_prepend(*ioFileMonitors, monitorData);
 
-		g_debug("Added file monitor for path '%s'", path);
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Added file monitor for path '%s'",
+							path);
 	}
 		/* ... otherwise free file monitor data */
 		else
 		{
 			if(monitorData) _xfdashboard_application_database_monitor_data_free(monitorData);
 
-			g_debug("Destroying file monitor for path '%s'", path);
+			XFDASHBOARD_DEBUG(self, APPLICATIONS,
+								"Destroying file monitor for path '%s'",
+								path);
 		}
 
-	g_debug("Finished scanning directory '%s' for search path '%s'",
-				path,
-				topLevelPath);
+	XFDASHBOARD_DEBUG(self, APPLICATIONS,
+						"Finished scanning directory '%s' for search path '%s'",
+						path,
+						topLevelPath);
 
 	/* Release allocated resources */
 	if(path) g_free(path);
@@ -1030,7 +1070,9 @@ static gboolean _xfdashboard_application_database_load_applications(XfdashboardA
 
 		if(directory) g_object_unref(directory);
 	}
-	g_debug("Loaded %u applications desktop files", g_hash_table_size(apps));
+	XFDASHBOARD_DEBUG(self, APPLICATIONS,
+						"Loaded %u applications desktop files",
+						g_hash_table_size(apps));
 
 	/* Release old list of installed applications and set new one */
 	if(priv->applications)
@@ -1096,7 +1138,9 @@ static gboolean _xfdashboard_application_database_load_application_menu(Xfdashbo
 
 		return(FALSE);
 	}
-	g_debug("Loaded application menu '%s'", garcon_menu_element_get_name(GARCON_MENU_ELEMENT(appsMenu)));
+	XFDASHBOARD_DEBUG(self, APPLICATIONS,
+						"Loaded application menu '%s'",
+						garcon_menu_element_get_name(GARCON_MENU_ELEMENT(appsMenu)));
 
 	/* Release old menus and set new one */
 	if(priv->appsMenu)
@@ -1320,7 +1364,9 @@ static void xfdashboard_application_database_init(XfdashboardApplicationDatabase
 	/* Set up search paths but eliminate duplicates */
 	path=g_build_filename(g_get_user_data_dir(), "applications", NULL);
 	priv->searchPaths=g_list_append(priv->searchPaths, path);
-	g_debug("Added search path '%s' to application database", path);
+	XFDASHBOARD_DEBUG(self, APPLICATIONS,
+						"Added search path '%s' to application database",
+						path);
 
 	systemPaths=g_get_system_data_dirs();
 	while(*systemPaths)
@@ -1341,7 +1387,9 @@ static void xfdashboard_application_database_init(XfdashboardApplicationDatabase
 		if(searchPathUnique)
 		{
 			priv->searchPaths=g_list_append(priv->searchPaths, g_strdup(searchPathUnique));
-			g_debug("Added search path '%s' to application database", searchPathUnique);
+			XFDASHBOARD_DEBUG(self, APPLICATIONS,
+								"Added search path '%s' to application database",
+								searchPathUnique);
 		}
 
 		/* Release allocated resources */
diff --git a/libxfdashboard/application-tracker.c b/libxfdashboard/application-tracker.c
index bfcaec6..db20192 100644
--- a/libxfdashboard/application-tracker.c
+++ b/libxfdashboard/application-tracker.c
@@ -34,6 +34,7 @@
 #include <libxfdashboard/window-tracker.h>
 #include <libxfdashboard/marshal.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -296,10 +297,11 @@ static GHashTable* _xfdashboard_application_tracker_get_environment_from_pid(gin
 	procEnvFile=g_strdup_printf("/proc/%d/environ", inPID);
 	if(!g_file_get_contents(procEnvFile, &envContent, &envLength, &error))
 	{
-		g_debug("Could not read enviroment varibles for PID %d at %s: %s",
-					inPID,
-					procEnvFile,
-					error ? error->message : _("Unknown error"));
+		XFDASHBOARD_DEBUG(NULL, APPLICATIONS,
+							"Could not read enviroment varibles for PID %d at %s: %s",
+							inPID,
+							procEnvFile,
+							error ? error->message : _("Unknown error"));
 
 		/* Release allocated resources */
 		if(error) g_error_free(error);
@@ -311,10 +313,11 @@ static GHashTable* _xfdashboard_application_tracker_get_environment_from_pid(gin
 		return(NULL);
 	}
 
-	g_debug("Enviroment set for PID %d at %s is %lu bytes long",
-				inPID,
-				procEnvFile,
-				envLength);
+	XFDASHBOARD_DEBUG(NULL, APPLICATIONS,
+						"Enviroment set for PID %d at %s is %lu bytes long",
+						inPID,
+						procEnvFile,
+						envLength);
 
 	/* Iterate through enviroment variables and insert copy of environment
 	 * variable's name as key and the copy of its value as value into hash-table.
@@ -450,8 +453,9 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_environmen
 	windowPID=xfdashboard_window_tracker_window_get_pid(inWindow);
 	if(windowPID<=0)
 	{
-		g_debug("Could not get PID for window '%s' of a running application to parse environment variables",
-				xfdashboard_window_tracker_window_get_title(inWindow));
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Could not get PID for window '%s' of a running application to parse environment variables",
+							xfdashboard_window_tracker_window_get_title(inWindow));
 
 		/* Return NULL result */
 		return(NULL);
@@ -461,9 +465,10 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_environmen
 	environments=_xfdashboard_application_tracker_get_environment_from_pid(windowPID);
 	if(!environments)
 	{
-		g_debug("Could not get environments for PID %d of windows '%s'",
-				windowPID,
-				xfdashboard_window_tracker_window_get_title(inWindow));
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Could not get environments for PID %d of windows '%s'",
+							windowPID,
+							xfdashboard_window_tracker_window_get_title(inWindow));
 
 		/* Return NULL result */
 		return(NULL);
@@ -476,9 +481,10 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_environmen
 	 */
 	if(!g_hash_table_lookup_extended(environments, "GIO_LAUNCHED_DESKTOP_FILE_PID", NULL, (gpointer)&value))
 	{
-		g_debug("Missing 'GIO_LAUNCHED_DESKTOP_FILE_PID' in environment variables for PID %d of windows '%s'",
-					windowPID,
-					xfdashboard_window_tracker_window_get_title(inWindow));
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Missing 'GIO_LAUNCHED_DESKTOP_FILE_PID' in environment variables for PID %d of windows '%s'",
+							windowPID,
+							xfdashboard_window_tracker_window_get_title(inWindow));
 
 		/* Release allocated resources */
 		if(environments) g_hash_table_destroy(environments);
@@ -490,10 +496,11 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_environmen
 	checkPID=atoi(value);
 	if(checkPID!=windowPID)
 	{
-		g_debug("PID %d of environment variables does not match requested window PID %d for '%s'",
-					checkPID,
-					windowPID,
-					xfdashboard_window_tracker_window_get_title(inWindow));
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"PID %d of environment variables does not match requested window PID %d for '%s'",
+							checkPID,
+							windowPID,
+							xfdashboard_window_tracker_window_get_title(inWindow));
 
 		/* Release allocated resources */
 		if(environments) g_hash_table_destroy(environments);
@@ -507,9 +514,10 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_environmen
 	 */
 	if(!g_hash_table_lookup_extended(environments, "GIO_LAUNCHED_DESKTOP_FILE", NULL, (gpointer)&value))
 	{
-		g_debug("Missing 'GIO_LAUNCHED_DESKTOP_FILE' in environment variables for PID %d of windows '%s'",
-					windowPID,
-					xfdashboard_window_tracker_window_get_title(inWindow));
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Missing 'GIO_LAUNCHED_DESKTOP_FILE' in environment variables for PID %d of windows '%s'",
+							windowPID,
+							xfdashboard_window_tracker_window_get_title(inWindow));
 
 		/* Release allocated resources */
 		if(environments) g_hash_table_destroy(environments);
@@ -536,9 +544,10 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_environmen
 	/* Return found application info which may be NULL if not found in
 	 * application database.
 	 */
-	g_debug("Resolved enviroment variables of window '%s' to desktop ID '%s'",
-				xfdashboard_window_tracker_window_get_title(inWindow),
-				foundAppInfo ? g_app_info_get_id(foundAppInfo) : "<nil>");
+	XFDASHBOARD_DEBUG(self, APPLICATIONS,
+						"Resolved enviroment variables of window '%s' to desktop ID '%s'",
+						xfdashboard_window_tracker_window_get_title(inWindow),
+						foundAppInfo ? g_app_info_get_id(foundAppInfo) : "<nil>");
 
 	return(foundAppInfo);
 }
@@ -624,10 +633,11 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_window_nam
 				if(g_pattern_match_string(globPattern, g_app_info_get_id(globAppInfo)))
 				{
 					foundSubdirApps=g_list_prepend(foundSubdirApps, globAppInfo);
-					g_debug("Found possible application '%s' for window '%s' using pattern '%s'",
-							g_app_info_get_id(globAppInfo),
-							xfdashboard_window_tracker_window_get_title(inWindow),
-							globName);
+					XFDASHBOARD_DEBUG(self, APPLICATIONS,
+										"Found possible application '%s' for window '%s' using pattern '%s'",
+										g_app_info_get_id(globAppInfo),
+										xfdashboard_window_tracker_window_get_title(inWindow),
+										globName);
 				}
 			}
 
@@ -638,10 +648,11 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_window_nam
 			{
 				appInfo=G_APP_INFO(g_object_ref(G_OBJECT(foundSubdirApps->data)));
 
-				g_debug("Found exactly one application named '%s' for window '%s' using pattern '%s'",
-						g_app_info_get_id(appInfo),
-						xfdashboard_window_tracker_window_get_title(inWindow),
-						globName);
+				XFDASHBOARD_DEBUG(self, APPLICATIONS,
+									"Found exactly one application named '%s' for window '%s' using pattern '%s'",
+									g_app_info_get_id(appInfo),
+									xfdashboard_window_tracker_window_get_title(inWindow),
+									globName);
 			}
 
 			/* Release allocated resources */
@@ -670,10 +681,11 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_window_nam
 		if(foundAppInfo &&
 			!g_app_info_equal(foundAppInfo, appInfo))
 		{
-			g_debug("Resolved window names of '%s' are ambiguous - discarding desktop IDs '%s' and '%s'",
-						xfdashboard_window_tracker_window_get_title(inWindow),
-						g_app_info_get_id(foundAppInfo),
-						g_app_info_get_id(appInfo));
+			XFDASHBOARD_DEBUG(self, APPLICATIONS,
+								"Resolved window names of '%s' are ambiguous - discarding desktop IDs '%s' and '%s'",
+								xfdashboard_window_tracker_window_get_title(inWindow),
+								g_app_info_get_id(foundAppInfo),
+								g_app_info_get_id(appInfo));
 
 			/* Release allocated resources */
 			if(iterName) g_free(iterName);
@@ -703,9 +715,10 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_window_nam
 	if(apps) g_list_free_full(apps, g_object_unref);
 
 	/* Return found application info */
-	g_debug("Resolved window names of '%s' to desktop ID '%s'",
-				xfdashboard_window_tracker_window_get_title(inWindow),
-				foundAppInfo ? g_app_info_get_id(foundAppInfo) : "<nil>");
+	XFDASHBOARD_DEBUG(self, APPLICATIONS,
+						"Resolved window names of '%s' to desktop ID '%s'",
+						xfdashboard_window_tracker_window_get_title(inWindow),
+						foundAppInfo ? g_app_info_get_id(foundAppInfo) : "<nil>");
 
 	return(foundAppInfo);
 }
@@ -732,16 +745,18 @@ static void _xfdashboard_application_tracker_on_window_opened(XfdashboardApplica
 	 */
 	if(xfdashboard_window_tracker_window_is_skip_pager(inWindow))
 	{
-		g_debug("Do not resolve window '%s' as it has skip-pager set.",
-					xfdashboard_window_tracker_window_get_title(inWindow));
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Do not resolve window '%s' as it has skip-pager set.",
+							xfdashboard_window_tracker_window_get_title(inWindow));
 
 		return;
 	}
 
 	if(xfdashboard_window_tracker_window_is_skip_tasklist(inWindow))
 	{
-		g_debug("Do not resolve window '%s' as it has skip-tasklist set.",
-					xfdashboard_window_tracker_window_get_title(inWindow));
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Do not resolve window '%s' as it has skip-tasklist set.",
+							xfdashboard_window_tracker_window_get_title(inWindow));
 
 		return;
 	}
@@ -753,15 +768,17 @@ static void _xfdashboard_application_tracker_on_window_opened(XfdashboardApplica
 	/* If we could not resolve window to a desktop application info, then stop here */
 	if(!appInfo)
 	{
-		g_debug("Could not resolve window '%s' to any desktop ID",
-					xfdashboard_window_tracker_window_get_title(inWindow));
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Could not resolve window '%s' to any desktop ID",
+							xfdashboard_window_tracker_window_get_title(inWindow));
 
 		return;
 	}
 
-	g_debug("Window '%s' belongs to desktop ID '%s'",
-				xfdashboard_window_tracker_window_get_title(inWindow),
-				g_app_info_get_id(appInfo));
+	XFDASHBOARD_DEBUG(self, APPLICATIONS,
+						"Window '%s' belongs to desktop ID '%s'",
+						xfdashboard_window_tracker_window_get_title(inWindow),
+						g_app_info_get_id(appInfo));
 
 	/* Create application tracker if no one exists for application and window ... */
 	item= _xfdashboard_application_tracker_find_item_by_app_info(self, appInfo);
@@ -774,7 +791,9 @@ static void _xfdashboard_application_tracker_on_window_opened(XfdashboardApplica
 		priv->runningApps=g_list_prepend(priv->runningApps, item);
 
 		/* Emit signal as this application is known to be running now */
-		g_debug("Emitting signal 'state-changed' to running for desktop ID '%s'", item->desktopID);
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Emitting signal 'state-changed' to running for desktop ID '%s'",
+							item->desktopID);
 		g_signal_emit(self, XfdashboardApplicationTrackerSignals[SIGNAL_STATE_CHANGED], g_quark_from_string(item->desktopID), item->desktopID, TRUE);
 	}
 		/* ... otherwise add window to existing one */
@@ -807,15 +826,17 @@ static void _xfdashboard_application_tracker_on_window_closed(XfdashboardApplica
 	item= _xfdashboard_application_tracker_find_item_by_window(self, inWindow);
 	if(!item)
 	{
-		g_debug("Could not find running application for window '%s'",
-					xfdashboard_window_tracker_window_get_title(inWindow));
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Could not find running application for window '%s'",
+							xfdashboard_window_tracker_window_get_title(inWindow));
 
 		return;
 	}
 
-	g_debug("Closing window '%s' for desktop ID '%s'",
-				xfdashboard_window_tracker_window_get_title(inWindow),
-				item->desktopID);
+	XFDASHBOARD_DEBUG(self, APPLICATIONS,
+						"Closing window '%s' for desktop ID '%s'",
+						xfdashboard_window_tracker_window_get_title(inWindow),
+						item->desktopID);
 
 	/* Remove window from found application tracker item */
 	_xfdashboard_application_tracker_item_remove_window(item, inWindow);
@@ -828,9 +849,10 @@ static void _xfdashboard_application_tracker_on_window_closed(XfdashboardApplica
 	{
 		gchar								*desktopID;
 
-		g_debug("Closing window '%s' for desktop ID '%s' closed last window so remove application from list of running ones",
-					xfdashboard_window_tracker_window_get_title(inWindow),
-					item->desktopID);
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Closing window '%s' for desktop ID '%s' closed last window so remove application from list of running ones",
+							xfdashboard_window_tracker_window_get_title(inWindow),
+							item->desktopID);
 
 		/* Create a copy of desktop ID for signal emission because the
 		 * application tracker item will be removed and freed before.
@@ -844,7 +866,9 @@ static void _xfdashboard_application_tracker_on_window_closed(XfdashboardApplica
 		_xfdashboard_application_tracker_item_free(item);
 
 		/* Emit signal as this application is not running anymore */
-		g_debug("Emitting signal 'state-changed' to stopped for desktop ID '%s'", desktopID);
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Emitting signal 'state-changed' to stopped for desktop ID '%s'",
+							desktopID);
 		g_signal_emit(self, XfdashboardApplicationTrackerSignals[SIGNAL_STATE_CHANGED], g_quark_from_string(desktopID), desktopID, FALSE);
 
 		/* Release allocated resources */
@@ -868,7 +892,7 @@ static void _xfdashboard_application_tracker_on_active_window_changed(Xfdashboar
 	 */
 	if(!inNewActiveWindow)
 	{
-		g_debug("No new active window to check for running application.");
+		XFDASHBOARD_DEBUG(self, APPLICATIONS, "No new active window to check for running application.");
 		return;
 	}
 
@@ -878,15 +902,17 @@ static void _xfdashboard_application_tracker_on_active_window_changed(Xfdashboar
 	item=_xfdashboard_application_tracker_find_item_by_window(self, inNewActiveWindow);
 	if(!item)
 	{
-		g_debug("Could not find running application for new active window '%s'",
-					xfdashboard_window_tracker_window_get_title(inNewActiveWindow));
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Could not find running application for new active window '%s'",
+							xfdashboard_window_tracker_window_get_title(inNewActiveWindow));
 
 		return;
 	}
 
-	g_debug("New active window is '%s' and belongs to desktop ID '%s'",
-				xfdashboard_window_tracker_window_get_title(inNewActiveWindow),
-				item->desktopID);
+	XFDASHBOARD_DEBUG(self, APPLICATIONS,
+						"New active window is '%s' and belongs to desktop ID '%s'",
+						xfdashboard_window_tracker_window_get_title(inNewActiveWindow),
+						item->desktopID);
 
 	/* Move new active window of found application tracker item to begin of
 	 * list of windows by removing window from list and prepending it to list
diff --git a/libxfdashboard/application.c b/libxfdashboard/application.c
index ee5685b..267eaf4 100644
--- a/libxfdashboard/application.c
+++ b/libxfdashboard/application.c
@@ -61,6 +61,7 @@
 #include <libxfdashboard/plugins-manager.h>
 #include <libxfdashboard/marshal.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -251,7 +252,7 @@ static void _xfdashboard_application_on_session_quit(XfdashboardApplication *sel
 	g_return_if_fail(XFCE_IS_SM_CLIENT(inUserData));
 
 	/* Force application to quit */
-	g_debug("Received 'quit' from session management client - initiating shutdown");
+	XFDASHBOARD_DEBUG(self, MISC, "Received 'quit' from session management client - initiating shutdown");
 	_xfdashboard_application_quit(self, TRUE);
 }
 
@@ -533,12 +534,14 @@ static void _xfdashboard_application_switch_to_view(XfdashboardApplication *self
 	if(!inInternalViewName ||
 		!inInternalViewName[0])
 	{
-		g_debug("No view to switch to specified");
+		XFDASHBOARD_DEBUG(self, MISC, "No view to switch to specified");
 		return;
 	}
 
 	/* Tell stage to switch requested view */
-	g_debug("Trying to switch to view '%s'", inInternalViewName);
+	XFDASHBOARD_DEBUG(self, MISC,
+						"Trying to switch to view '%s'",
+						inInternalViewName);
 	xfdashboard_stage_set_switch_to_view(priv->stage, inInternalViewName);
 }
 
@@ -592,6 +595,10 @@ static gint _xfdashboard_application_handle_command_line_arguments(XfdashboardAp
 	 */
 	g_print("** To get debug messages set environment variable G_MESSAGES_DEBUG to %s\n", PACKAGE_NAME);
 	g_print("** e.g.: G_MESSAGES_DEBUG=%s %s\n", PACKAGE_NAME, inArgv[0]);
+#ifdef XFDASHBOARD_ENABLE_DEBUG
+	g_print("** Use environment variable XFDASHBOARD_DEBUG to enable debug messages also as G_MESSAGES_DEBUG=%s will be deprecated\n",
+				PACKAGE_NAME);
+#endif
 #endif
 
 	if(!g_option_context_parse(context, &inArgc, &inArgv, &error))
@@ -612,6 +619,51 @@ static gint _xfdashboard_application_handle_command_line_arguments(XfdashboardAp
 		return(XFDASHBOARD_APPLICATION_ERROR_FAILED);
 	}
 
+	/* Set up debug flags */
+#ifdef XFDASHBOARD_ENABLE_DEBUG
+	{
+		const gchar					*environment;
+		static const GDebugKey		debugKeys[]=
+									{
+										{ "misc", XFDASHBOARD_DEBUG_MISC },
+										{ "actor", XFDASHBOARD_DEBUG_ACTOR },
+										{ "style", XFDASHBOARD_DEBUG_STYLE },
+										{ "styling", XFDASHBOARD_DEBUG_STYLE },
+										{ "theme", XFDASHBOARD_DEBUG_THEME },
+										{ "apps", XFDASHBOARD_DEBUG_APPLICATIONS },
+										{ "applications", XFDASHBOARD_DEBUG_APPLICATIONS },
+										{ "images", XFDASHBOARD_DEBUG_IMAGES },
+										{ "windows", XFDASHBOARD_DEBUG_WINDOWS },
+										{ "window-tracker", XFDASHBOARD_DEBUG_WINDOWS },
+									};
+
+		/* Parse debug flags */
+		environment=g_getenv("XFDASHBOARD_DEBUG");
+		if(environment)
+		{
+			xfdashboard_debug_flags=
+				g_parse_debug_string(environment,
+										debugKeys,
+										G_N_ELEMENTS(debugKeys));
+			environment=NULL;
+		}
+
+		/* Parse object names to debug */
+		environment=g_getenv("XFDASHBOARD_DEBUG");
+		if(environment)
+		{
+			if(G_UNLIKELY(xfdashboard_debug_classes))
+			{
+				g_strfreev(xfdashboard_debug_classes);
+				xfdashboard_debug_classes=NULL;
+			}
+
+			xfdashboard_debug_classes=g_strsplit(environment, ",", -1);
+			environment=NULL;
+		}
+	}
+#endif
+
 	/* If this application instance is a remote instance do not handle any
 	 * command-line argument. The arguments will be sent to the primary instance,
 	 * handled there and the exit code will be sent back to the remote instance.
@@ -621,7 +673,7 @@ static gint _xfdashboard_application_handle_command_line_arguments(XfdashboardAp
 	 */
 	if(g_application_get_is_remote(G_APPLICATION(self)))
 	{
-		g_debug("Do not handle command-line parameters on remote application instance");
+		XFDASHBOARD_DEBUG(self, MISC, "Do not handle command-line parameters on remote application instance");
 
 		/* Release allocated resources */
 		if(optionSwitchToView) g_free(optionSwitchToView);
@@ -632,7 +684,7 @@ static gint _xfdashboard_application_handle_command_line_arguments(XfdashboardAp
 		 */
 		return(XFDASHBOARD_APPLICATION_ERROR_NONE);
 	}
-	g_debug("Handling command-line parameters on primary application instance");
+	XFDASHBOARD_DEBUG(self, MISC, "Handling command-line parameters on primary application instance");
 
 	/* Handle options: restart
 	 *
@@ -645,7 +697,7 @@ static gint _xfdashboard_application_handle_command_line_arguments(XfdashboardAp
 		priv->initialized)
 	{
 		/* Quit existing instance for restart */
-		g_debug("Received request to restart application!");
+		XFDASHBOARD_DEBUG(self, MISC, "Received request to restart application!");
 		_xfdashboard_application_quit(self, TRUE);
 
 		/* Release allocated resources */
@@ -665,7 +717,7 @@ static gint _xfdashboard_application_handle_command_line_arguments(XfdashboardAp
 	if(optionQuit)
 	{
 		/* Quit existing instance */
-		g_debug("Received request to quit running instance!");
+		XFDASHBOARD_DEBUG(self, MISC, "Received request to quit running instance!");
 		_xfdashboard_application_quit(self, TRUE);
 
 		/* Release allocated resources */
diff --git a/libxfdashboard/applications-menu-model.c b/libxfdashboard/applications-menu-model.c
index d3dceaf..412a52e 100644
--- a/libxfdashboard/applications-menu-model.c
+++ b/libxfdashboard/applications-menu-model.c
@@ -31,6 +31,7 @@
 #include <libxfdashboard/applications-menu-model.h>
 #include <libxfdashboard/application-database.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define these classes in GObject system */
@@ -119,7 +120,7 @@ static void _xfdashboard_applications_menu_model_on_reload_required(XfdashboardA
 	g_return_if_fail(XFDASHBOARD_IS_APPLICATION_DATABASE(inUserData));
 
 	/* Reload menu by filling it again. This also emits all necessary signals. */
-	g_debug("Applications menu has changed and needs to be reloaded.");
+	XFDASHBOARD_DEBUG(self, APPLICATIONS, "Applications menu has changed and needs to be reloaded.");
 	_xfdashboard_applications_menu_model_fill_model(self);
 }
 
@@ -802,7 +803,9 @@ void xfdashboard_applications_menu_model_filter_by_section(XfdashboardApplicatio
 	/* Filter model data */
 	if(inSection)
 	{
-		g_debug("Filtering section '%s'", garcon_menu_element_get_name(GARCON_MENU_ELEMENT(inSection)));
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Filtering section '%s'",
+							garcon_menu_element_get_name(GARCON_MENU_ELEMENT(inSection)));
 		xfdashboard_model_set_filter(XFDASHBOARD_MODEL(self),
 										_xfdashboard_applications_menu_model_filter_by_section,
 										g_object_ref(inSection),
@@ -810,7 +813,7 @@ void xfdashboard_applications_menu_model_filter_by_section(XfdashboardApplicatio
 	}
 		else
 		{
-			g_debug("Filtering root section because no section requested");
+			XFDASHBOARD_DEBUG(self, APPLICATIONS, "Filtering root section because no section requested");
 			xfdashboard_model_set_filter(XFDASHBOARD_MODEL(self),
 											_xfdashboard_applications_menu_model_filter_empty,
 											NULL,
diff --git a/libxfdashboard/applications-search-provider.c b/libxfdashboard/applications-search-provider.c
index c8b568b..3540ae3 100644
--- a/libxfdashboard/applications-search-provider.c
+++ b/libxfdashboard/applications-search-provider.c
@@ -39,6 +39,7 @@
 #include <libxfdashboard/utils.h>
 #include <libxfdashboard/enums.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -379,14 +380,16 @@ static gboolean _xfdashboard_applications_search_provider_load_statistics(Xfdash
 			return(FALSE);
 		}
 	}
-	g_debug("Will load statistics of applications search provider from %s",
-			_xfdashboard_applications_search_provider_statistics.filename);
+	XFDASHBOARD_DEBUG(self, APPLICATIONS,
+						"Will load statistics of applications search provider from %s",
+						_xfdashboard_applications_search_provider_statistics.filename);
 
 	/* If statistics file does not exist then return immediately but with success */
 	if(!g_file_test(_xfdashboard_applications_search_provider_statistics.filename, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
 	{
-		g_debug("Statistics file %s does not exists. Will create empty statistics database for applications search provider",
-				_xfdashboard_applications_search_provider_statistics.filename);
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Statistics file %s does not exists. Will create empty statistics database for applications search provider",
+							_xfdashboard_applications_search_provider_statistics.filename);
 
 		return(TRUE);
 	}
@@ -419,7 +422,9 @@ static gboolean _xfdashboard_applications_search_provider_load_statistics(Xfdash
 
 		return(FALSE);
 	}
-	g_debug("Will load statistics for %d applications", entriesCount);
+	XFDASHBOARD_DEBUG(self, APPLICATIONS,
+						"Will load statistics for %d applications",
+						entriesCount);
 
 	allAppIDs=NULL;
 	while(entriesCount>0)
@@ -450,7 +455,9 @@ static gboolean _xfdashboard_applications_search_provider_load_statistics(Xfdash
 
 		/* Store application desktop ID in list to iterate */
 		allAppIDs=g_list_prepend(allAppIDs, appID);
-		g_debug("Will load statistics for application '%s'", appID);
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Will load statistics for application '%s'",
+							appID);
 
 		/* Continue with next application in entries group */
 		entriesCount--;
@@ -500,7 +507,9 @@ static gboolean _xfdashboard_applications_search_provider_load_statistics(Xfdash
 
 		/* Store statistics data for application in hash-table */
 		g_hash_table_insert(_xfdashboard_applications_search_provider_statistics.stats, g_strdup(appID), _xfdashboard_applications_search_provider_statistics_ref(stats));
-		g_debug("Loaded and stored statistics for '%s' for applications search provider", appID);
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Loaded and stored statistics for '%s' for applications search provider",
+							appID);
 
 		/* Release allocated resources */
 		_xfdashboard_applications_search_provider_statistics_unref(stats);
@@ -511,8 +520,9 @@ static gboolean _xfdashboard_applications_search_provider_load_statistics(Xfdash
 	if(keyFile) g_key_file_free(keyFile);
 
 	/* If we get here saving statistics file was successful */
-	g_debug("Loaded statistics of applications search provider from %s",
-			_xfdashboard_applications_search_provider_statistics.filename);
+	XFDASHBOARD_DEBUG(self, APPLICATIONS,
+						"Loaded statistics of applications search provider from %s",
+						_xfdashboard_applications_search_provider_statistics.filename);
 
 	return(TRUE);
 }
@@ -558,7 +568,7 @@ static void _xfdashboard_applications_search_provider_destroy_statistics(void)
 	}
 
 	/* Destroy statistics */
-	g_debug("Destroying statistics of applications search provider");
+	XFDASHBOARD_DEBUG(NULL, APPLICATIONS, "Destroying statistics of applications search provider");
 	g_hash_table_destroy(_xfdashboard_applications_search_provider_statistics.stats);
 	_xfdashboard_applications_search_provider_statistics.stats=NULL;
 
@@ -604,7 +614,7 @@ static void _xfdashboard_applications_search_provider_create_statistics(Xfdashbo
 								g_str_equal,
 								g_free,
 								(GDestroyNotify)_xfdashboard_applications_search_provider_statistics_unref);
-	g_debug("Created statistics of applications search provider");
+	XFDASHBOARD_DEBUG(self, APPLICATIONS, "Created statistics of applications search provider");
 
 	/* Load statistics from file */
 	if(!_xfdashboard_applications_search_provider_load_statistics(self, &error))
diff --git a/libxfdashboard/applications-view.c b/libxfdashboard/applications-view.c
index 40d7ae1..95a5657 100644
--- a/libxfdashboard/applications-view.c
+++ b/libxfdashboard/applications-view.c
@@ -45,6 +45,7 @@
 #include <libxfdashboard/desktop-app-info.h>
 #include <libxfdashboard/application-database.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -907,11 +908,12 @@ static ClutterActor* xfdashboard_applications_view_get_selection_from_icon_mode(
 	if(newSelection) selection=newSelection;
 
 	/* Return new selection */
-	g_debug("Selecting %s at %s for current selection %s in direction %u",
-			selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
-			G_OBJECT_TYPE_NAME(self),
-			inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
-			inDirection);
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Selecting %s at %s for current selection %s in direction %u",
+						selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
+						G_OBJECT_TYPE_NAME(self),
+						inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
+						inDirection);
 	return(selection);
 }
 
@@ -1027,11 +1029,12 @@ static ClutterActor* xfdashboard_applications_view_get_selection_from_list_mode(
 	if(newSelection) selection=newSelection;
 
 	/* Return new selection */
-	g_debug("Selecting %s at %s for current selection %s in direction %u",
-			selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
-			G_OBJECT_TYPE_NAME(self),
-			inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
-			inDirection);
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Selecting %s at %s for current selection %s in direction %u",
+						selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
+						G_OBJECT_TYPE_NAME(self),
+						inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
+						inDirection);
 	return(selection);
 }
 
@@ -1061,10 +1064,11 @@ static ClutterActor* _xfdashboard_applications_view_focusable_find_selection(Xfd
 		newSelection=clutter_actor_get_first_child(CLUTTER_ACTOR(self));
 
 		valueName=xfdashboard_get_enum_value_name(XFDASHBOARD_TYPE_SELECTION_TARGET, inDirection);
-		g_debug("No selection at %s, so select first child %s for direction %s",
-				G_OBJECT_TYPE_NAME(self),
-				newSelection ? G_OBJECT_TYPE_NAME(newSelection) : "<nil>",
-				valueName);
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"No selection at %s, so select first child %s for direction %s",
+							G_OBJECT_TYPE_NAME(self),
+							newSelection ? G_OBJECT_TYPE_NAME(newSelection) : "<nil>",
+							valueName);
 		g_free(valueName);
 
 		return(newSelection);
@@ -1133,11 +1137,12 @@ static ClutterActor* _xfdashboard_applications_view_focusable_find_selection(Xfd
 	if(newSelection) selection=newSelection;
 
 	/* Return new selection found */
-	g_debug("Selecting %s at %s for current selection %s in direction %u",
-			selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
-			G_OBJECT_TYPE_NAME(self),
-			inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
-			inDirection);
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Selecting %s at %s for current selection %s in direction %u",
+						selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
+						G_OBJECT_TYPE_NAME(self),
+						inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
+						inDirection);
 
 	return(selection);
 }
diff --git a/libxfdashboard/binding.c b/libxfdashboard/binding.c
index cb43206..ffd4586 100644
--- a/libxfdashboard/binding.c
+++ b/libxfdashboard/binding.c
@@ -31,6 +31,7 @@
 #include <libxfdashboard/binding.h>
 #include <libxfdashboard/enums.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -336,7 +337,9 @@ XfdashboardBinding* xfdashboard_binding_new_for_event(const ClutterEvent *inEven
 			break;
 
 		default:
-			g_debug("Cannot create binding instance for unsupported or invalid event type %d", eventType);
+			XFDASHBOARD_DEBUG(binding, MISC,
+								"Cannot create binding instance for unsupported or invalid event type %d",
+								eventType);
 
 			/* Release allocated resources */
 			g_object_unref(binding);
diff --git a/libxfdashboard/bindings-pool.c b/libxfdashboard/bindings-pool.c
index bfbbd0b..a40018f 100644
--- a/libxfdashboard/bindings-pool.c
+++ b/libxfdashboard/bindings-pool.c
@@ -34,6 +34,7 @@
 
 #include <libxfdashboard/utils.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -194,7 +195,9 @@ static gboolean _xfdashboard_bindings_pool_parse_keycode(const gchar *inText,
 	key=0;
 	modifiers=0;
 
-	g_debug("Trying to translating key-binding '%s' to keycode and modifiers", inText);
+	XFDASHBOARD_DEBUG(NULL, MISC,
+						"Trying to translating key-binding '%s' to keycode and modifiers",
+						inText);
 
 	/* Split text into parts. Valid delimiters are '+', '-', white-spaces. */
 	parts=xfdashboard_split_string(inText, "+- \t");
@@ -312,7 +315,11 @@ static gboolean _xfdashboard_bindings_pool_parse_keycode(const gchar *inText,
 	if(outKey) *outKey=key;
 	if(outModifiers) *outModifiers=modifiers;
 
-	g_debug("Translated key-binding '%s' to keycode %04x and modifiers %04x", inText, key, modifiers);
+	XFDASHBOARD_DEBUG(NULL, MISC,
+						"Translated key-binding '%s' to keycode %04x and modifiers %04x",
+						inText,
+						key,
+						modifiers);
 
 	/* Return with success result */
 	return(TRUE);
@@ -808,7 +815,9 @@ static gboolean _xfdashboard_bindings_pool_load_bindings_from_file(XfdashboardBi
 	error=NULL;
 	success=TRUE;
 
-	g_debug("Loading bindings from %s'", inPath);
+	XFDASHBOARD_DEBUG(self, MISC,
+						"Loading bindings from %s'",
+						inPath);
 
 	/* Load XML file into memory */
 	error=NULL;
@@ -1024,7 +1033,9 @@ gboolean xfdashboard_bindings_pool_load(XfdashboardBindingsPool *self, GError **
 		if(envFile)
 		{
 			configFile=g_strdup(envFile);
-			g_debug("Trying bindings configuration file: %s", configFile);
+			XFDASHBOARD_DEBUG(self, MISC,
+								"Trying bindings configuration file: %s",
+								configFile);
 			if(!g_file_test(configFile, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
 			{
 				g_free(configFile);
@@ -1041,7 +1052,9 @@ gboolean xfdashboard_bindings_pool_load(XfdashboardBindingsPool *self, GError **
 	if(!configFile)
 	{
 		configFile=g_build_filename(g_get_user_config_dir(), "xfdashboard", "bindings.xml", NULL);
-		g_debug("Trying bindings configuration file: %s", configFile);
+		XFDASHBOARD_DEBUG(self, MISC,
+							"Trying bindings configuration file: %s",
+							configFile);
 		if(!g_file_test(configFile, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
 		{
 			g_free(configFile);
@@ -1055,7 +1068,9 @@ gboolean xfdashboard_bindings_pool_load(XfdashboardBindingsPool *self, GError **
 	if(!configFile)
 	{
 		configFile=g_build_filename(PACKAGE_DATADIR, "xfdashboard", "bindings.xml", NULL);
-		g_debug("Trying bindings configuration file: %s", configFile);
+		XFDASHBOARD_DEBUG(self, MISC,
+							"Trying bindings configuration file: %s",
+							configFile);
 		if(!g_file_test(configFile, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
 		{
 			g_free(configFile);
@@ -1140,10 +1155,11 @@ const XfdashboardBinding* xfdashboard_bindings_pool_find_for_event(XfdashboardBi
 		/* Check if we have a binding matching lookup binding */
 		if(g_hash_table_lookup_extended(priv->bindings, lookupBinding, (gpointer*)&foundBinding, NULL))
 		{
-			g_debug("Found binding for class=%s, key=%04x, mods=%04x",
-					xfdashboard_binding_get_class_name(lookupBinding),
-					xfdashboard_binding_get_key(lookupBinding),
-					xfdashboard_binding_get_modifiers(lookupBinding));
+			XFDASHBOARD_DEBUG(self, MISC,
+								"Found binding for class=%s, key=%04x, mods=%04x",
+								xfdashboard_binding_get_class_name(lookupBinding),
+								xfdashboard_binding_get_key(lookupBinding),
+								xfdashboard_binding_get_modifiers(lookupBinding));
 
 			/* Found a binding so stop iterating through classes of actor */
 			if(interfaces) g_slist_free(interfaces);
@@ -1188,10 +1204,11 @@ const XfdashboardBinding* xfdashboard_bindings_pool_find_for_event(XfdashboardBi
 			/* Check for matching binding */
 			if(g_hash_table_lookup_extended(priv->bindings, lookupBinding, (gpointer*)&foundBinding, NULL))
 			{
-				g_debug("Found binding for interface=%s for key=%04x, mods=%04x",
-						xfdashboard_binding_get_class_name(lookupBinding),
-						xfdashboard_binding_get_key(lookupBinding),
-						xfdashboard_binding_get_modifiers(lookupBinding));
+				XFDASHBOARD_DEBUG(self, MISC,
+									"Found binding for interface=%s for key=%04x, mods=%04x",
+									xfdashboard_binding_get_class_name(lookupBinding),
+									xfdashboard_binding_get_key(lookupBinding),
+									xfdashboard_binding_get_modifiers(lookupBinding));
 
 				/* Found a binding so stop iterating through classes of actor */
 				if(interfaces) g_slist_free(interfaces);
diff --git a/libxfdashboard/compat.h b/libxfdashboard/compat.h
index 9e6ba0c..1ad15e5 100644
--- a/libxfdashboard/compat.h
+++ b/libxfdashboard/compat.h
@@ -39,6 +39,21 @@ G_BEGIN_DECLS
 #define clutter_actor_get_reactive(actor)	CLUTTER_ACTOR_IS_REACTIVE( (actor) )
 #endif
 
+#if !GLIB_CHECK_VERSION(2, 44, 0)
+inline static gboolean g_strv_contains(const gchar * const *inStringList, const gchar *inString)
+{
+	g_return_val_if_fail(inStringList, FALSE);
+	g_return_val_if_fail(inString, FALSE);
+
+	for(; *inStringList; inStringList++)
+	{
+		if(g_str_equal(inString, *inStringList)) return(TRUE);
+	}
+
+	return(FALSE);
+}
+#endif
+
 G_END_DECLS
 
 #endif	/* __LIBXFDASHBOARD_COMPAT__ */
diff --git a/libxfdashboard/css-selector.c b/libxfdashboard/css-selector.c
index 210029c..ac6791e 100644
--- a/libxfdashboard/css-selector.c
+++ b/libxfdashboard/css-selector.c
@@ -30,6 +30,7 @@
 #include <glib/gi18n-lib.h>
 
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -539,7 +540,13 @@ static GTokenType _xfdashboard_css_selector_parse_css_simple_selector(Xfdashboar
 				/* Return immediately if ID was already set because it should be a new child but print a debug message */
 				if(ioRule->id)
 				{
-					g_debug("Unexpected new ID '%s' at rule %p for previous ID '%s' at line %d and position %d", inScanner->value.v_identifier, ioRule, ioRule->id, g_scanner_cur_line(inScanner), g_scanner_cur_position(inScanner));
+					XFDASHBOARD_DEBUG(self, STYLE,
+										"Unexpected new ID '%s' at rule %p for previous ID '%s' at line %d and position %d",
+										inScanner->value.v_identifier,
+										ioRule,
+										ioRule->id,
+										g_scanner_cur_line(inScanner),
+										g_scanner_cur_position(inScanner));
 					return(G_TOKEN_NONE);
 				}
 
diff --git a/libxfdashboard/debug.c b/libxfdashboard/debug.c
new file mode 100644
index 0000000..6a6bb96
--- /dev/null
+++ b/libxfdashboard/debug.c
@@ -0,0 +1,72 @@
+/*
+ * debug: Helpers for debugging
+ * 
+ * Copyright 2012-2017 Stephan Haller <nomad at froevel.de>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ * 
+ * 
+ */
+
+/**
+ * SECTION:debug
+ * @short_description: Debug functions and macros
+ * @include: xfdashboard/debug.h
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <libxfdashboard/debug.h>
+
+
+/* IMPLEMENTATION: Public API */
+guint		xfdashboard_debug_flags=0;
+gchar		**xfdashboard_debug_classes=NULL;
+
+void xfdashboard_debug_messagev(const char *inFormat, va_list inArgs)
+{
+	static gint64		beginDebugTimestamp=-1;
+	gchar				*timestamp;
+	gchar				*format;
+	gint64				currentTime;
+	gfloat				debugTimestamp;
+
+	/* Get current time */
+	currentTime=g_get_monotonic_time();
+	if(beginDebugTimestamp<0) beginDebugTimestamp=currentTime;
+	debugTimestamp=(((gfloat)currentTime)-((gfloat)beginDebugTimestamp)) / G_USEC_PER_SEC;
+	timestamp=g_strdup_printf("[%+16.4f]", debugTimestamp);
+
+	/* Create new format used for message containing the timestamp */
+	format=g_strconcat(timestamp, ":", inFormat, NULL);
+	g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, format, inArgs);
+
+	/* Release allocated ressources */
+	g_free(format);
+	g_free(timestamp);
+}
+
+void xfdashboard_debug_message(const char *inFormat, ...)
+{
+	va_list		args;
+
+	va_start(args, inFormat);
+	xfdashboard_debug_messagev(inFormat, args);
+	va_end(args);
+}
diff --git a/libxfdashboard/debug.h b/libxfdashboard/debug.h
new file mode 100644
index 0000000..cfee614
--- /dev/null
+++ b/libxfdashboard/debug.h
@@ -0,0 +1,119 @@
+/*
+ * debug: Helpers for debugging
+ * 
+ * Copyright 2012-2017 Stephan Haller <nomad at froevel.de>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ * 
+ * 
+ */
+
+#ifndef __LIBXFDASHBOARD_DEBUG__
+#define __LIBXFDASHBOARD_DEBUG__
+
+#if !defined(__LIBXFDASHBOARD_H_INSIDE__) && !defined(LIBXFDASHBOARD_COMPILATION)
+#error "Only <libxfdashboard/libxfdashboard.h> can be included directly."
+#endif
+
+#include <glib.h>
+#include "compat.h"
+
+G_BEGIN_DECLS
+
+/* Public definitions */
+/**
+ * XfdashboardDebugFlags:
+ * @XFDASHBOARD_DEBUG_MISC: Miscellaneous, if debug message does not fit in any other category
+ * @XFDASHBOARD_DEBUG_ACTOR: Actor related debug messages
+ * @XFDASHBOARD_DEBUG_STYLE: Style at actor debug messages (resolving CSS, applying style etc.)
+ * @XFDASHBOARD_DEBUG_THEME: Theme related debug messages (loading theme and resources etc.)
+ * @XFDASHBOARD_DEBUG_APPLICATIONS: Application related debug message (spawing application process, application database and tracker etc.)
+ * @XFDASHBOARD_DEBUG_IMAGES: Images related debug message (image cache etc.)
+ * @XFDASHBOARD_DEBUG_WINDOWS: Windows related debug message (window tracker, workspaces, windows, monitors etc.)
+ * @XFDASHBOARD_DEBUG_PLUGINS: Plug-ins related debug message (plugin manager and plugin base class)
+ *
+ * Debug categories
+ */
+typedef enum /*< skip,flags,prefix=XFDASHBOARD_DEBUG >*/
+{
+	XFDASHBOARD_DEBUG_MISC			= 1 << 0,
+	XFDASHBOARD_DEBUG_ACTOR			= 1 << 1,
+	XFDASHBOARD_DEBUG_STYLE			= 1 << 2,
+	XFDASHBOARD_DEBUG_THEME			= 1 << 3,
+	XFDASHBOARD_DEBUG_APPLICATIONS	= 1 << 4,
+	XFDASHBOARD_DEBUG_IMAGES		= 1 << 5,
+	XFDASHBOARD_DEBUG_WINDOWS		= 1 << 6,
+	XFDASHBOARD_DEBUG_PLUGINS		= 1 << 7,
+} XfdashboardDebugFlags;
+
+#ifdef XFDASHBOARD_ENABLE_DEBUG
+
+#define XFDASHBOARD_HAS_DEBUG(inCategory) \
+	((xfdashboard_debug_flags & XFDASHBOARD_DEBUG_##inCategory) != FALSE)
+
+#ifndef __GNUC__
+
+/* Try the GCC extension for valists in macros */
+#define XFDASHBOARD_DEBUG(self, inCategory, inMessage, inArgs...)              \
+	G_STMT_START \
+	{ \
+		if(G_UNLIKELY(XFDASHBOARD_HAS_DEBUG(inCategory)) ||                    \
+			G_UNLIKELY(xfdashboard_debug_classes && self && g_strv_contains((const gchar * const *)xfdashboard_debug_classes, G_OBJECT_TYPE_NAME(self))))\
+		{ \
+			xfdashboard_debug_message("[%s@%p]:[" #inCategory "]:" G_STRLOC ": " inMessage, (self ? G_OBJECT_TYPE_NAME(self) : ""), self, ##inArgs);\
+		} \
+	} \
+	G_STMT_END
+
+#else /* !__GNUC__ */
+
+/* Try the C99 version; unfortunately, this does not allow us to pass empty
+ * arguments to the macro, which means we have to do an intemediate printf.
+ */
+#define XFDASHBOARD_DEBUG(self, inCategory, ...)                               \
+	G_STMT_START \
+	{ \
+		if(G_UNLIKELY(XFDASHBOARD_HAS_DEBUG(inCategory)) ||                    \
+			G_UNLIKELY(xfdashboard_debug_classes && self && g_strv_contains((const gchar * const *)xfdashboard_debug_classes, G_OBJECT_TYPE_NAME(self))))\
+		{ \
+			gchar	*_xfdashboard_debug_format=g_strdup_printf(__VA_ARGS__);     \
+			xfdashboard_debug_message("[%s@%p]:[" #inCategory "]:" G_STRLOC ": %s", (self ? G_OBJECT_TYPE_NAME(self) : ""), self, _xfdashboard_debug_format);\
+			g_free(_xfdashboard_debug_format);                                 \
+		} \
+	} \
+	G_STMT_END
+#endif
+
+#else /* !XFDASHBOARD_ENABLE_DEBUG */
+
+#define XFDASHBOARD_HAS_DEBUG(inCategory)		FALSE
+#define XFDASHBOARD_DEBUG(inCategory, ...)		G_STMT_START { } G_STMT_END
+
+#endif /* XFDASHBOARD_ENABLE_DEBUG */
+
+/* Public data */
+
+extern guint xfdashboard_debug_flags;
+extern gchar **xfdashboard_debug_classes;
+
+/* Public API */
+
+void xfdashboard_debug_messagev(const char *inFormat, va_list inArgs);
+void xfdashboard_debug_message(const char *inFormat, ...) G_GNUC_PRINTF(1, 2);
+
+G_END_DECLS
+
+#endif	/* __LIBXFDASHBOARD_DEBUG__ */
diff --git a/libxfdashboard/desktop-app-info.c b/libxfdashboard/desktop-app-info.c
index 39f3dcc..57fc1e6 100644
--- a/libxfdashboard/desktop-app-info.c
+++ b/libxfdashboard/desktop-app-info.c
@@ -31,6 +31,7 @@
 #include <libxfdashboard/desktop-app-info.h>
 #include <libxfdashboard/application-database.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -626,7 +627,10 @@ static gboolean _xfdashboard_desktop_app_info_launch_appinfo_internal(Xfdashboar
 	{
 		GDBusConnection							*sessionBus;
 
-		g_debug("Launching %s succeeded with PID %ld.", garcon_menu_item_get_name(priv->item), (long)launchedPID);
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Launching %s succeeded with PID %ld.",
+							garcon_menu_item_get_name(priv->item),
+							(long)launchedPID);
 
 		/* Open connection to DBUS session bus and send notification about
 		 * successful launch of application. Then flush and close DBUS
@@ -1274,7 +1278,10 @@ GAppInfo* xfdashboard_desktop_app_info_new_from_desktop_id(const gchar *inDeskto
 		g_warning(_("Desktop ID '%s' not found"), inDesktopID);
 		return(NULL);
 	}
-	g_debug("Found desktop file '%s' for desktop ID '%s'", desktopFilename, inDesktopID);
+	XFDASHBOARD_DEBUG(NULL, APPLICATIONS,
+						"Found desktop file '%s' for desktop ID '%s'",
+						desktopFilename,
+						inDesktopID);
 
 	/* Create this class instance for desktop file found */
 	file=g_file_new_for_path(desktopFilename);
diff --git a/libxfdashboard/emblem-effect.c b/libxfdashboard/emblem-effect.c
index 8f82209..87b88bd 100644
--- a/libxfdashboard/emblem-effect.c
+++ b/libxfdashboard/emblem-effect.c
@@ -37,6 +37,7 @@
 #include <libxfdashboard/image-content.h>
 #include <libxfdashboard/enums.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -197,8 +198,9 @@ static void _xfdashboard_emblem_effect_paint(ClutterEffect *inEffect, ClutterEff
 	if(actorBox.x2<=actorBox.x1 ||
 		actorBox.y2<=actorBox.y1)
 	{
-		g_debug("Will not draw emblem '%s' because width or height of actor is zero or below after padding was applied.",
-				priv->iconName);
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Will not draw emblem '%s' because width or height of actor is zero or below after padding was applied.",
+							priv->iconName);
 		return;
 	}
 
@@ -310,9 +312,10 @@ static void _xfdashboard_emblem_effect_paint(ClutterEffect *inEffect, ClutterEff
 	if(loadingState!=XFDASHBOARD_IMAGE_CONTENT_LOADING_STATE_LOADED_SUCCESSFULLY &&
 		loadingState!=XFDASHBOARD_IMAGE_CONTENT_LOADING_STATE_LOADED_FAILED)
 	{
-		g_debug("Emblem image '%s' is still being loaded at %s",
-				priv->iconName,
-				G_OBJECT_TYPE_NAME(inEffect));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Emblem image '%s' is still being loaded at %s",
+							priv->iconName,
+							G_OBJECT_TYPE_NAME(inEffect));
 		return;
 	}
 
diff --git a/libxfdashboard/focus-manager.c b/libxfdashboard/focus-manager.c
index 5e782ca..d31c1aa 100644
--- a/libxfdashboard/focus-manager.c
+++ b/libxfdashboard/focus-manager.c
@@ -35,6 +35,7 @@
 #include <libxfdashboard/bindings-pool.h>
 #include <libxfdashboard/application.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -174,10 +175,11 @@ static GSList* _xfdashboard_focus_manager_get_targets_for_binding(XfdashboardFoc
 	}
 
 	/* Return list of targets found */
-	g_debug("Target list for action '%s' and target class '%s' has %d entries",
-				xfdashboard_binding_get_action(inBinding),
-				xfdashboard_binding_get_target(inBinding),
-				g_slist_length(targets));
+	XFDASHBOARD_DEBUG(self, MISC,
+						"Target list for action '%s' and target class '%s' has %d entries",
+						xfdashboard_binding_get_action(inBinding),
+						xfdashboard_binding_get_target(inBinding),
+						g_slist_length(targets));
 	return(targets);
 }
 
@@ -425,7 +427,9 @@ void xfdashboard_focus_manager_register_after(XfdashboardFocusManager *self, Xfd
 	{
 		gint						insertPosition;
 
-		g_debug("Registering focusable %s", G_OBJECT_TYPE_NAME(inFocusable));
+		XFDASHBOARD_DEBUG(self, MISC,
+							"Registering focusable %s",
+							G_OBJECT_TYPE_NAME(inFocusable));
 
 		/* If requested find position of focusable actor to insert new focusable actor after.
 		 * Increase found position by one and add new focusable actor to list of registered
@@ -482,7 +486,9 @@ void xfdashboard_focus_manager_unregister(XfdashboardFocusManager *self, Xfdashb
 	 */
 	if(g_list_find(priv->registeredFocusables, inFocusable)!=NULL)
 	{
-		g_debug("Unregistering focusable %s", G_OBJECT_TYPE_NAME(inFocusable));
+		XFDASHBOARD_DEBUG(self, MISC,
+							"Unregistering focusable %s",
+							G_OBJECT_TYPE_NAME(inFocusable));
 
 		/* If we unregister the focusable actor which has the focus currently
 		 * move focus to next focusable actor first but check that we will not
@@ -635,9 +641,10 @@ GSList* xfdashboard_focus_manager_get_targets(XfdashboardFocusManager *self, con
 	}
 
 	/* Return list of targets found */
-	g_debug("Target list for target class '%s' has %d entries",
-				inTarget,
-				g_slist_length(targets));
+	XFDASHBOARD_DEBUG(self, MISC,
+						"Target list for target class '%s' has %d entries",
+						inTarget,
+						g_slist_length(targets));
 
 	return(targets);
 }
@@ -699,14 +706,16 @@ void xfdashboard_focus_manager_set_focus(XfdashboardFocusManager *self, Xfdashbo
 		newFocusable=xfdashboard_focus_manager_get_next_focusable(self, inFocusable);
 		if(!newFocusable)
 		{
-			g_debug("Requested focusable actor '%s' cannot be focus but no other focusable actor was found",
-						G_OBJECT_TYPE_NAME(inFocusable));
+			XFDASHBOARD_DEBUG(self, MISC,
+								"Requested focusable actor '%s' cannot be focus but no other focusable actor was found",
+								G_OBJECT_TYPE_NAME(inFocusable));
 			return;
 		}
 
-		g_debug("Requested focusable actor '%s' cannot be focused - moving focus to '%s'",
-				G_OBJECT_TYPE_NAME(inFocusable),
-				newFocusable ? G_OBJECT_TYPE_NAME(newFocusable) : "<nothing>");
+		XFDASHBOARD_DEBUG(self, MISC,
+							"Requested focusable actor '%s' cannot be focused - moving focus to '%s'",
+							G_OBJECT_TYPE_NAME(inFocusable),
+							newFocusable ? G_OBJECT_TYPE_NAME(newFocusable) : "<nothing>");
 		inFocusable=newFocusable;
 	}
 
@@ -714,7 +723,7 @@ void xfdashboard_focus_manager_set_focus(XfdashboardFocusManager *self, Xfdashbo
 	oldFocusable=priv->currentFocus;
 	if(oldFocusable==inFocusable)
 	{
-		g_debug("Current focused actor and new one are the same so do nothing.");
+		XFDASHBOARD_DEBUG(self, MISC, "Current focused actor and new one are the same so do nothing.");
 		return;
 	}
 
@@ -728,9 +737,10 @@ void xfdashboard_focus_manager_set_focus(XfdashboardFocusManager *self, Xfdashbo
 	/* Set focus to new focusable actor */
 	priv->currentFocus=inFocusable;
 	xfdashboard_focusable_set_focus(priv->currentFocus);
-	g_debug("Moved focus from '%s' to '%s'",
-				oldFocusable ? G_OBJECT_TYPE_NAME(oldFocusable) : "<nothing>",
-				G_OBJECT_TYPE_NAME(priv->currentFocus));
+	XFDASHBOARD_DEBUG(self, MISC,
+						"Moved focus from '%s' to '%s'",
+						oldFocusable ? G_OBJECT_TYPE_NAME(oldFocusable) : "<nothing>",
+						G_OBJECT_TYPE_NAME(priv->currentFocus));
 
 	/* Emit signal for changed focus */
 	g_signal_emit(self, XfdashboardFocusManagerSignals[SIGNAL_CHANGED], 0, oldFocusable, priv->currentFocus);
@@ -993,9 +1003,10 @@ gboolean xfdashboard_focus_manager_handle_key_event(XfdashboardFocusManager *sel
 		eventStatus=CLUTTER_EVENT_PROPAGATE;
 
 		/* Emit action of binding to each actor in target list just build up */
-		g_debug("Target list for action '%s' has %d actors",
-					action,
-					g_slist_length(targetFocusables));
+		XFDASHBOARD_DEBUG(self, MISC,
+							"Target list for action '%s' has %d actors",
+							action,
+							g_slist_length(targetFocusables));
 
 		for(iter=targetFocusables; iter; iter=g_slist_next(iter))
 		{
@@ -1075,14 +1086,16 @@ gboolean xfdashboard_focus_manager_handle_key_event(XfdashboardFocusManager *sel
 #endif
 
 			/* Emit action signal at target */
-			g_debug("Emitting action signal '%s' at focusable actor %s",
-						action,
-						G_OBJECT_TYPE_NAME(targetObject));
+			XFDASHBOARD_DEBUG(self, ACTOR,
+								"Emitting action signal '%s' at focusable actor %s",
+								action,
+								G_OBJECT_TYPE_NAME(targetObject));
 			g_signal_emit_by_name(targetObject, action, inFocusable, action, inEvent, &eventStatus);
-			g_debug("Action signal '%s' was %s by focusable actor %s",
-						action,
-						eventStatus==CLUTTER_EVENT_STOP ? "handled" : "not handled",
-						G_OBJECT_TYPE_NAME(targetObject));
+			XFDASHBOARD_DEBUG(self, ACTOR,
+								"Action signal '%s' was %s by focusable actor %s",
+								action,
+								eventStatus==CLUTTER_EVENT_STOP ? "handled" : "not handled",
+								G_OBJECT_TYPE_NAME(targetObject));
 		}
 
 		/* Release allocated resources */
diff --git a/libxfdashboard/focusable.c b/libxfdashboard/focusable.c
index 634340a..fce0d4d 100644
--- a/libxfdashboard/focusable.c
+++ b/libxfdashboard/focusable.c
@@ -38,6 +38,7 @@
 #include <libxfdashboard/focus-manager.h>
 #include <libxfdashboard/application.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this interface in GObject system */
@@ -668,14 +669,17 @@ void xfdashboard_focusable_set_focus(XfdashboardFocusable *self)
 			xfdashboard_stylable_add_pseudo_class(XFDASHBOARD_STYLABLE(selection), "selected");
 		}
 
-		g_debug("Set selection to %s for focused actor %s",
-				G_OBJECT_TYPE_NAME(self),
-				selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>");
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Set selection to %s for focused actor %s",
+							G_OBJECT_TYPE_NAME(self),
+							selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>");
 	}
 
 	/* Emit signal */
 	g_signal_emit(self, XfdashboardFocusableSignals[SIGNAL_FOCUS_GAINED], 0, self);
-	g_debug("Emitted signal 'focus-gained' for focused actor %s", G_OBJECT_TYPE_NAME(self));
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Emitted signal 'focus-gained' for focused actor %s",
+						G_OBJECT_TYPE_NAME(self));
 }
 
 /* Call virtual function "unset_focus" */
@@ -713,14 +717,17 @@ void xfdashboard_focusable_unset_focus(XfdashboardFocusable *self)
 			xfdashboard_stylable_remove_pseudo_class(XFDASHBOARD_STYLABLE(selection), "selected");
 		}
 
-		g_debug("Unstyled selection %s for focus loosing actor %s",
-				G_OBJECT_TYPE_NAME(self),
-				selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>");
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Unstyled selection %s for focus loosing actor %s",
+							G_OBJECT_TYPE_NAME(self),
+							selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>");
 	}
 
 	/* Emit signal */
 	g_signal_emit(self, XfdashboardFocusableSignals[SIGNAL_FOCUS_LOST], 0, self);
-	g_debug("Emitted signal 'focus-lost' for focused actor %s", G_OBJECT_TYPE_NAME(self));
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Emitted signal 'focus-lost' for focused actor %s",
+						G_OBJECT_TYPE_NAME(self));
 }
 
 /* Call virtual function "supports_selection" */
diff --git a/libxfdashboard/image-content.c b/libxfdashboard/image-content.c
index 375bd39..92e962b 100644
--- a/libxfdashboard/image-content.c
+++ b/libxfdashboard/image-content.c
@@ -34,6 +34,7 @@
 #include <libxfdashboard/application.h>
 #include <libxfdashboard/stylable.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 #if GTK_CHECK_VERSION(3, 14 ,0)
@@ -136,7 +137,10 @@ static ClutterImage* _xfdashboard_image_content_get_cached_image(const gchar *in
 	/* Get loaded image and reference it */
 	image=CLUTTER_IMAGE(g_hash_table_lookup(_xfdashboard_image_content_cache, inKey));
 	g_object_ref(image);
-	g_debug("Using cached image '%s' - ref-count is now %d" , inKey, G_OBJECT(image)->ref_count);
+	XFDASHBOARD_DEBUG(image, IMAGES,
+						"Using cached image '%s' - ref-count is now %d" ,
+						inKey,
+						G_OBJECT(image)->ref_count);
 
 	return(image);
 }
@@ -179,7 +183,7 @@ static void _xfdashboard_image_content_destroy_cache(void)
 	}
 #endif
 
-	g_debug("Destroying image cache hashtable");
+	XFDASHBOARD_DEBUG(NULL, IMAGES, "Destroying image cache hashtable");
 	g_hash_table_destroy(_xfdashboard_image_content_cache);
 	_xfdashboard_image_content_cache=NULL;
 }
@@ -194,7 +198,7 @@ static void _xfdashboard_image_content_create_cache(void)
 
 	/* Create create hashtable */
 	_xfdashboard_image_content_cache=g_hash_table_new(g_str_hash, g_str_equal);
-	g_debug("Created image cache hashtable");
+	XFDASHBOARD_DEBUG(NULL, IMAGES, "Created image cache hashtable");
 
 	/* Connect to "shutdown" signal of application to
 	 * clean up hashtable
@@ -216,7 +220,10 @@ static void _xfdashboard_image_content_remove_from_cache(XfdashboardImageContent
 	if(!_xfdashboard_image_content_cache) return;
 
 	/* Remove from cache */
-	g_debug("Removing image '%s' with ref-count %d" , priv->key, G_OBJECT(self)->ref_count);
+	XFDASHBOARD_DEBUG(self, IMAGES,
+						"Removing image '%s' with ref-count %d",
+						priv->key,
+						G_OBJECT(self)->ref_count);
 	g_hash_table_remove(_xfdashboard_image_content_cache, priv->key);
 }
 
@@ -254,13 +261,19 @@ static void _xfdashboard_image_content_store_in_cache(XfdashboardImageContent *s
 		if(content)
 		{
 			g_object_unref(content);
-			g_debug("Replacing image '%s' which had ref-count %u", priv->key, G_OBJECT(content)->ref_count);
+			XFDASHBOARD_DEBUG(self, IMAGES,
+								"Replacing image '%s' which had ref-count %u",
+								priv->key,
+								G_OBJECT(content)->ref_count);
 		}
 	}
 
 	/* Store new image in cache */
 	g_hash_table_insert(_xfdashboard_image_content_cache, priv->key, self);
-	g_debug("Added image '%s' with ref-count %d" , priv->key, G_OBJECT(self)->ref_count);
+	XFDASHBOARD_DEBUG(self, IMAGES,
+						"Added image '%s' with ref-count %d",
+						priv->key,
+						G_OBJECT(self)->ref_count);
 }
 
 /* Set an empty image of size 1x1 pixels (e.g. when loading asynchronously) */
@@ -339,13 +352,17 @@ static void _xfdashboard_image_content_loading_async_callback(GObject *inSource,
 	if(priv->loadState==XFDASHBOARD_IMAGE_CONTENT_LOADING_STATE_LOADED_SUCCESSFULLY)
 	{
 		g_signal_emit(self, XfdashboardImageContentSignals[SIGNAL_LOADED], 0);
-		g_debug("Successfully loaded image for key '%s' asynchronously", priv->key ? priv->key : "<nil>");
+		XFDASHBOARD_DEBUG(self, IMAGES,
+							"Successfully loaded image for key '%s' asynchronously",
+							priv->key ? priv->key : "<nil>");
 	}
 		/* ... or emit "loading-failed" signal if loading has failed. */
 		else
 		{
 			g_signal_emit(self, XfdashboardImageContentSignals[SIGNAL_LOADING_FAILED], 0);
-			g_debug("Failed to load image for key '%s' asynchronously", priv->key ? priv->key : "<nil>");
+			XFDASHBOARD_DEBUG(self, IMAGES,
+								"Failed to load image for key '%s' asynchronously",
+								priv->key ? priv->key : "<nil>");
 		}
 
 	/* Now release the extra reference we took to keep this instance alive
@@ -444,7 +461,12 @@ static void _xfdashboard_image_content_load_from_file(XfdashboardImageContent *s
 					error=NULL;
 				}
 			}
-				else g_debug("Loaded fallback icon for file '%s' from built-in pixbuf", priv->iconName);
+				else
+				{
+					XFDASHBOARD_DEBUG(self, IMAGES,
+										"Loaded fallback icon for file '%s' from built-in pixbuf",
+										priv->iconName);
+				}
 
 			g_object_unref(iconPixbuf);
 		}
@@ -500,7 +522,10 @@ static void _xfdashboard_image_content_load_from_file(XfdashboardImageContent *s
 													(GAsyncReadyCallback)_xfdashboard_image_content_loading_async_callback,
 													g_object_ref(self));
 
-		g_debug("Loading icon '%s' from file %s", priv->iconName, filename);
+		XFDASHBOARD_DEBUG(self, IMAGES,
+							"Loading icon '%s' from file %s",
+							priv->iconName,
+							filename);
 
 		/* Release allocated resources */
 		g_object_unref(stream);
@@ -534,9 +559,10 @@ static gboolean _xfdashboard_image_content_load_from_icon_name_is_supported_suff
 		if(g_strcmp0(inExtension+1, *entry)==0)
 		{
 			isSupported=TRUE;
-			g_debug("Extension '%s' is supported by '%s'",
-						inExtension+1,
-						gdk_pixbuf_format_get_description(inFormat));
+			XFDASHBOARD_DEBUG(NULL, IMAGES,
+								"Extension '%s' is supported by '%s'",
+								inExtension+1,
+								gdk_pixbuf_format_get_description(inFormat));
 		}
 	}
 
@@ -589,7 +615,10 @@ static void _xfdashboard_image_content_load_from_icon_name(XfdashboardImageConte
 
 			/* Get suffix - the file extension */
 			extension=g_utf8_casefold(extensionPosition, -1);
-			g_debug("Checking if icon filename '%s' with suffix '%s' is supported by gdk-pixbuf", priv->iconName, extensionPosition);
+			XFDASHBOARD_DEBUG(self, IMAGES,
+								"Checking if icon filename '%s' with suffix '%s' is supported by gdk-pixbuf",
+								priv->iconName,
+								extensionPosition);
 
 			/* Get all formats supported by gdk-pixbuf and check if
 			 * suffix matches any of them.
@@ -628,12 +657,24 @@ static void _xfdashboard_image_content_load_from_icon_name(XfdashboardImageConte
 #endif
 
 				if(!iconInfo) g_warning(_("Could not lookup icon name '%s' for icon '%s'"), iconName, priv->iconName);
-					else g_debug("Extension '%s' is supported and loaded icon name '%s' for icon '%s'", extension, iconName, priv->iconName);
+					else
+					{
+						XFDASHBOARD_DEBUG(self, IMAGES,
+											"Extension '%s' is supported and loaded icon name '%s' for icon '%s'",
+											extension,
+											iconName,
+											priv->iconName);
+					}
 
 				/* Release allocated resources */
 				g_free(iconName);
 			}
-				else g_debug("Extension '%s' is not supported by gdk-pixbuf", extension);
+				else
+				{
+					XFDASHBOARD_DEBUG(self, IMAGES,
+										"Extension '%s' is not supported by gdk-pixbuf",
+										extension);
+				}
 
 			/* Release allocated resources */
 			g_free(extension);
@@ -686,7 +727,12 @@ static void _xfdashboard_image_content_load_from_icon_name(XfdashboardImageConte
 				error=NULL;
 			}
 		}
-			else g_debug("Loaded image data into content for icon '%s' from built-in pixbuf", priv->iconName);
+			else
+			{
+				XFDASHBOARD_DEBUG(self, IMAGES,
+									"Loaded image data into content for icon '%s' from built-in pixbuf",
+									priv->iconName);
+			}
 
 		g_object_unref(iconPixbuf);
 	}
@@ -737,7 +783,10 @@ static void _xfdashboard_image_content_load_from_icon_name(XfdashboardImageConte
 			g_object_unref(stream);
 			g_object_unref(file);
 
-			g_debug("Loading icon '%s' from icon file %s", priv->iconName, filename);
+			XFDASHBOARD_DEBUG(self, IMAGES,
+								"Loading icon '%s' from icon file %s",
+								priv->iconName,
+								filename);
 		}
 
 	/* Release allocated resources */
@@ -814,7 +863,12 @@ static void _xfdashboard_image_content_load_from_gicon(XfdashboardImageContent *
 				error=NULL;
 			}
 		}
-			else g_debug("Loaded image data into content for gicon '%s' from built-in pixbuf", g_icon_to_string(priv->gicon));
+			else
+			{
+				XFDASHBOARD_DEBUG(self, IMAGES,
+									"Loaded image data into content for gicon '%s' from built-in pixbuf",
+									g_icon_to_string(priv->gicon));
+			}
 
 		g_object_unref(iconPixbuf);
 	}
@@ -862,9 +916,10 @@ static void _xfdashboard_image_content_load_from_gicon(XfdashboardImageContent *
 			g_object_unref(stream);
 			g_object_unref(file);
 
-			g_debug("Loading gicon '%s' from file %s",
-						g_icon_to_string(priv->gicon),
-						filename);
+			XFDASHBOARD_DEBUG(self, IMAGES,
+								"Loading gicon '%s' from file %s",
+								g_icon_to_string(priv->gicon),
+								filename);
 		}
 
 	/* Release allocated resources */
@@ -992,7 +1047,9 @@ static void _xfdashboard_image_content_load(XfdashboardImageContent *self)
 	/* If image is in state of getting loaded or finished loading then do nothing */
 	if(priv->loadState!=XFDASHBOARD_IMAGE_CONTENT_LOADING_STATE_NONE) return;
 
-	g_debug("Begin loading image with key '%s'", priv->key);
+	XFDASHBOARD_DEBUG(self, IMAGES,
+						"Begin loading image with key '%s'",
+						priv->key);
 
 	/* Mark image being loaded */
 	priv->loadState=XFDASHBOARD_IMAGE_CONTENT_LOADING_STATE_LOADING;
@@ -1068,10 +1125,11 @@ static void _xfdashboard_image_content_on_actor_mapped(XfdashboardImageContent *
 		g_list_foreach(priv->actors, _xfdashboard_image_content_disconnect_signals_handlers_from_actor, self);
 
 		/* Load image now */
-		g_debug("Image with key '%s' will be loaded now because actor %s@%p is mapped now",
-					priv->key,
-					actor ? G_OBJECT_TYPE_NAME(actor) : "<nil>",
-					actor);
+		XFDASHBOARD_DEBUG(self, IMAGES,
+							"Image with key '%s' will be loaded now because actor %s@%p is mapped now",
+							priv->key,
+							actor ? G_OBJECT_TYPE_NAME(actor) : "<nil>",
+							actor);
 
 		_xfdashboard_image_content_load(self);
 	}
@@ -1100,11 +1158,12 @@ static void _xfdashboard_image_content_on_attached(ClutterContent *inContent,
 	if(inActor &&
 		CLUTTER_IS_ACTOR(inActor))
 	{
-		g_debug("Attached image with key '%s' to %s actor %s@%p",
-				priv->key,
-				(inActor && clutter_actor_is_mapped(inActor)) ? "mapped" : "unmapped",
-				inActor ? G_OBJECT_TYPE_NAME(inActor) : "<nil>",
-				inActor);
+		XFDASHBOARD_DEBUG(self, IMAGES,
+							"Attached image with key '%s' to %s actor %s@%p",
+							priv->key,
+							(inActor && clutter_actor_is_mapped(inActor)) ? "mapped" : "unmapped",
+							inActor ? G_OBJECT_TYPE_NAME(inActor) : "<nil>",
+							inActor);
 
 		/* Add actor to list of known actors using this image content. Avoid
 		 * duplicates in this list although it should never happen.
@@ -1164,7 +1223,9 @@ static void _xfdashboard_image_content_on_attached(ClutterContent *inContent,
 	/* If we get here then either the actor is mapped or we got not an actor at
 	 * all, so start loading image now. Otherwise it will never get loaded.
 	 */
-	g_debug("Attached image with key '%s' need to get loaded immediately", priv->key);
+	XFDASHBOARD_DEBUG(self, IMAGES,
+						"Attached image with key '%s' need to get loaded immediately",
+						priv->key);
 	_xfdashboard_image_content_load(self);
 }
 
@@ -1198,10 +1259,11 @@ static void _xfdashboard_image_content_on_detached(ClutterContent *inContent,
 		/* Disconnect signal handler */
 		g_signal_handlers_disconnect_by_data(inActor, self);
 
-		g_debug("Detached image with key '%s' from actor %s@%p",
-					priv->key,
-					inActor ? G_OBJECT_TYPE_NAME(inActor) : "<nil>",
-					inActor);
+		XFDASHBOARD_DEBUG(self, IMAGES,
+							"Detached image with key '%s' from actor %s@%p",
+							priv->key,
+							inActor ? G_OBJECT_TYPE_NAME(inActor) : "<nil>",
+							inActor);
 	}
 }
 
@@ -1691,7 +1753,9 @@ void xfdashboard_image_content_set_missing_icon_name(XfdashboardImageContent *se
 			 * then try to load the image.  It is likely that it will fail again
 			 * but then it will show the new missing icon instead of the old one.
 			 */
-			g_debug("Reload failed  image with key '%s' because of changed missing-icon property", priv->key);
+			XFDASHBOARD_DEBUG(self, IMAGES,
+								"Reload failed  image with key '%s' because of changed missing-icon property",
+								priv->key);
 			_xfdashboard_image_content_load(self);
 		}
 
@@ -1725,7 +1789,9 @@ void xfdashboard_image_content_force_load(XfdashboardImageContent *self)
 	 */
 	if(priv->loadState==XFDASHBOARD_IMAGE_CONTENT_LOADING_STATE_NONE)
 	{
-		g_debug("Need to enforce loading image with key '%s'", priv->key);
+		XFDASHBOARD_DEBUG(self, IMAGES,
+							"Need to enforce loading image with key '%s'",
+							priv->key);
 		_xfdashboard_image_content_load(self);
 	}
 }
diff --git a/libxfdashboard/live-workspace.c b/libxfdashboard/live-workspace.c
index 536e7a6..c1d1aae 100644
--- a/libxfdashboard/live-workspace.c
+++ b/libxfdashboard/live-workspace.c
@@ -38,6 +38,7 @@
 #include <libxfdashboard/enums.h>
 #include <libxfdashboard/stylable.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -427,8 +428,9 @@ static void _xfdashboard_live_workspace_on_desktop_window_opened(XfdashboardLive
 		g_signal_handlers_disconnect_by_func(priv->windowTracker,
 												G_CALLBACK(_xfdashboard_live_workspace_on_desktop_window_opened),
 												self);
-		g_debug("Found desktop window for workspace '%s' with signal 'window-opened', so disconnecting signal handler",
-				xfdashboard_window_tracker_workspace_get_name(priv->workspace));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Found desktop window for workspace '%s' with signal 'window-opened', so disconnecting signal handler",
+							xfdashboard_window_tracker_workspace_get_name(priv->workspace));
 	}
 }
 
@@ -1106,8 +1108,9 @@ void xfdashboard_live_workspace_set_background_image_type(XfdashboardLiveWorkspa
 						if(backgroundWindow)
 						{
 							xfdashboard_live_window_simple_set_window(XFDASHBOARD_LIVE_WINDOW_SIMPLE(priv->backgroundImageLayer), backgroundWindow);
-							g_debug("Desktop window was found and set up as background image for workspace '%s'",
-									xfdashboard_window_tracker_workspace_get_name(priv->workspace));
+							XFDASHBOARD_DEBUG(self, ACTOR,
+												"Desktop window was found and set up as background image for workspace '%s'",
+												xfdashboard_window_tracker_workspace_get_name(priv->workspace));
 						}
 							else
 							{
@@ -1115,8 +1118,9 @@ void xfdashboard_live_workspace_set_background_image_type(XfdashboardLiveWorkspa
 															"window-opened",
 															G_CALLBACK(_xfdashboard_live_workspace_on_desktop_window_opened),
 															self);
-								g_debug("Desktop window was not found. Setting up signal to get notified when desktop window might be opened for workspace '%s'",
-											xfdashboard_window_tracker_workspace_get_name(priv->workspace));
+								XFDASHBOARD_DEBUG(self, ACTOR,
+													"Desktop window was not found. Setting up signal to get notified when desktop window might be opened for workspace '%s'",
+													xfdashboard_window_tracker_workspace_get_name(priv->workspace));
 							}
 					}
 					break;
diff --git a/libxfdashboard/plugin.c b/libxfdashboard/plugin.c
index ae538f5..d2a860c 100644
--- a/libxfdashboard/plugin.c
+++ b/libxfdashboard/plugin.c
@@ -33,6 +33,7 @@
 #include <libxfdashboard/enums.h>
 #include <libxfdashboard/marshal.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Forward declaration */
@@ -541,14 +542,15 @@ static gboolean _xfdashboard_plugin_load(GTypeModule *inModule)
 	priv->state=XFDASHBOARD_PLUGIN_STATE_INITIALIZED;
 
 	/* If we get here then loading and initializing plugin was successful */
-	g_debug("Loaded plugin '%s' successfully:\n  File: %s\n  Name: %s\n  Description: %s\n  Author: %s\n  Copyright: %s\n  License: %s",
-				priv->id,
-				priv->filename,
-				priv->name ? priv->name : "",
-				priv->description ? priv->description : "",
-				priv->author ? priv->author : "",
-				priv->copyright ? priv->copyright : "",
-				priv->license ? priv->license : "");
+	XFDASHBOARD_DEBUG(self, PLUGINS,
+						"Loaded plugin '%s' successfully:\n  File: %s\n  Name: %s\n  Description: %s\n  Author: %s\n  Copyright: %s\n  License: %s",
+						priv->id,
+						priv->filename,
+						priv->name ? priv->name : "",
+						priv->description ? priv->description : "",
+						priv->author ? priv->author : "",
+						priv->copyright ? priv->copyright : "",
+						priv->license ? priv->license : "");
 
 	return(TRUE);
 }
@@ -568,7 +570,9 @@ static void _xfdashboard_plugin_unload(GTypeModule *inModule)
 	/* Disable plugin if it is still enabled */
 	if(priv->state==XFDASHBOARD_PLUGIN_STATE_ENABLED)
 	{
-		g_debug("Disabing plugin '%s' before unloading module", priv->id);
+		XFDASHBOARD_DEBUG(self, PLUGINS,
+							"Disabing plugin '%s' before unloading module",
+							priv->id);
 		xfdashboard_plugin_disable(self);
 	}
 
@@ -1118,7 +1122,9 @@ void xfdashboard_plugin_enable(XfdashboardPlugin *self)
 	/* Do nothing and return immediately if plugin is enabled already */
 	if(priv->state==XFDASHBOARD_PLUGIN_STATE_ENABLED)
 	{
-		g_debug("Plugin '%s' is already enabled", priv->id);
+		XFDASHBOARD_DEBUG(self, PLUGINS,
+							"Plugin '%s' is already enabled",
+							priv->id);
 		return;
 	}
 
@@ -1134,7 +1140,9 @@ void xfdashboard_plugin_enable(XfdashboardPlugin *self)
 
 	/* Emit signal action 'enable' to enable plugin */
 	g_signal_emit(self, XfdashboardPluginSignals[ACTION_ENABLE], 0, &result);
-	g_debug("Plugin '%s' enabled", priv->id);
+	XFDASHBOARD_DEBUG(self, PLUGINS,
+						"Plugin '%s' enabled",
+						priv->id);
 
 	/* Set enabled state */
 	priv->state=XFDASHBOARD_PLUGIN_STATE_ENABLED;
@@ -1153,13 +1161,17 @@ void xfdashboard_plugin_disable(XfdashboardPlugin *self)
 	/* Do nothing and return immediately if plugin is not enabled */
 	if(priv->state!=XFDASHBOARD_PLUGIN_STATE_ENABLED)
 	{
-		g_debug("Plugin '%s' is already disabled", priv->id);
+		XFDASHBOARD_DEBUG(self, PLUGINS,
+							"Plugin '%s' is already disabled",
+							priv->id);
 		return;
 	}
 
 	/* Emit signal action 'disable' to disable plugin */
 	g_signal_emit(self, XfdashboardPluginSignals[ACTION_DISABLE], 0, &result);
-	g_debug("Plugin '%s' disabled", priv->id);
+	XFDASHBOARD_DEBUG(self, PLUGINS,
+						"Plugin '%s' disabled",
+						priv->id);
 
 	/* Set disabled state, i.e. revert to initialized state */
 	priv->state=XFDASHBOARD_PLUGIN_STATE_INITIALIZED;
diff --git a/libxfdashboard/plugins-manager.c b/libxfdashboard/plugins-manager.c
index 385e30d..a2f54fb 100644
--- a/libxfdashboard/plugins-manager.c
+++ b/libxfdashboard/plugins-manager.c
@@ -47,6 +47,7 @@
 #include <libxfdashboard/plugin.h>
 #include <libxfdashboard/application.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -112,7 +113,9 @@ static gboolean _xfdashboard_plugins_manager_add_search_path(XfdashboardPluginsM
 		 */
 		if(g_strcmp0(iterPath, normalizedPath)==0)
 		{
-			g_debug("Path '%s' was already added to search paths of plugin manager", normalizedPath);
+			XFDASHBOARD_DEBUG(self, PLUGINS,
+								"Path '%s' was already added to search paths of plugin manager",
+								normalizedPath);
 
 			/* Release allocated resources */
 			if(normalizedPath) g_free(normalizedPath);
@@ -126,7 +129,9 @@ static gboolean _xfdashboard_plugins_manager_add_search_path(XfdashboardPluginsM
 	 * we can add it now.
 	 */
 	priv->searchPaths=g_list_append(priv->searchPaths, g_strdup(normalizedPath));
-	g_debug("Added path '%s' to search paths of plugin manager", normalizedPath);
+	XFDASHBOARD_DEBUG(self, PLUGINS,
+						"Added path '%s' to search paths of plugin manager",
+						normalizedPath);
 
 	/* Release allocated resources */
 	if(normalizedPath) g_free(normalizedPath);
@@ -164,7 +169,10 @@ static gchar* _xfdashboard_plugins_manager_find_plugin_path(XfdashboardPluginsMa
 		/* Check if file exists and return it if we does */
 		if(g_file_test(path, G_FILE_TEST_IS_REGULAR))
 		{
-			g_debug("Found path %s for plugin '%s'", path, inPluginName);
+			XFDASHBOARD_DEBUG(self, PLUGINS,
+								"Found path %s for plugin '%s'",
+								path,
+								inPluginName);
 			return(path);
 		}
 
@@ -173,7 +181,9 @@ static gchar* _xfdashboard_plugins_manager_find_plugin_path(XfdashboardPluginsMa
 	}
 
 	/* If we get here we did not found any suitable file, so return NULL */
-	g_debug("Plugin '%s' not found in search paths", inPluginName);
+	XFDASHBOARD_DEBUG(self, PLUGINS,
+						"Plugin '%s' not found in search paths",
+						inPluginName);
 	return(NULL);
 }
 
@@ -249,7 +259,9 @@ static gboolean _xfdashboard_plugins_manager_load_plugin(XfdashboardPluginsManag
 	/* Check if plugin with requested ID exists already in list of loaded plugins */
 	if(_xfdashboard_plugins_manager_has_plugin_id(self, inPluginID))
 	{
-		g_debug("Plugin ID '%s' already loaded.", inPluginID);
+		XFDASHBOARD_DEBUG(self, PLUGINS,
+							"Plugin ID '%s' already loaded.",
+							inPluginID);
 
 		/* The plugin is already loaded so return success result */
 		return(TRUE);
@@ -284,7 +296,9 @@ static gboolean _xfdashboard_plugins_manager_load_plugin(XfdashboardPluginsManag
 	/* Enable plugin if early initialization is requested by plugin */
 	if(xfdashboard_plugin_get_flags(plugin) & XFDASHBOARD_PLUGIN_FLAG_EARLY_INITIALIZATION)
 	{
-		g_debug("Enabling plugin '%s' on load because early initialization was requested", inPluginID);
+		XFDASHBOARD_DEBUG(self, PLUGINS,
+							"Enabling plugin '%s' on load because early initialization was requested",
+							inPluginID);
 		xfdashboard_plugin_enable(plugin);
 	}
 
@@ -361,7 +375,9 @@ static void _xfdashboard_plugins_manager_on_enabled_plugins_changed(XfdashboardP
 			/* Check that found flag is set. If it is not then disable plugin */
 			if(!found)
 			{
-				g_debug("Disable plugin '%s'", pluginID);
+				XFDASHBOARD_DEBUG(self, PLUGINS,
+									"Disable plugin '%s'",
+									pluginID);
 
 				/* Disable plugin */
 				xfdashboard_plugin_disable(plugin);
@@ -411,7 +427,12 @@ static void _xfdashboard_plugins_manager_on_enabled_plugins_changed(XfdashboardP
 						error=NULL;
 					}
 				}
-					else g_debug("Loaded plugin '%s'", pluginID);
+					else
+					{
+						XFDASHBOARD_DEBUG(self, PLUGINS,
+											"Loaded plugin '%s'",
+											pluginID);
+					}
 			}
 				else
 				{
@@ -420,7 +441,9 @@ static void _xfdashboard_plugins_manager_on_enabled_plugins_changed(XfdashboardP
 					 */
 					if(!xfdashboard_plugin_is_enabled(plugin))
 					{
-						g_debug("Re-enable plugin '%s'", pluginID);
+						XFDASHBOARD_DEBUG(self, PLUGINS,
+											"Re-enable plugin '%s'",
+											pluginID);
 						xfdashboard_plugin_enable(plugin);
 					}
 				}
@@ -449,7 +472,7 @@ static void _xfdashboard_plugins_manager_on_application_initialized(XfdashboardP
 	/* Iterate through all loaded plugins and enable all plugins which are
 	 * not enabled yet.
 	 */
-	g_debug("Plugin manager will now enable all remaining plugins because application is fully initialized now");
+	XFDASHBOARD_DEBUG(self, PLUGINS, "Plugin manager will now enable all remaining plugins because application is fully initialized now");
 	for(iter=priv->plugins; iter; iter=g_list_next(iter))
 	{
 		/* Get plugin */
@@ -459,7 +482,9 @@ static void _xfdashboard_plugins_manager_on_application_initialized(XfdashboardP
 		if(!xfdashboard_plugin_is_enabled(plugin))
 		{
 			/* Enable plugin */
-			g_debug("Enabling plugin '%s'", xfdashboard_plugin_get_id(plugin));
+			XFDASHBOARD_DEBUG(self, PLUGINS,
+								"Enabling plugin '%s'",
+								xfdashboard_plugin_get_id(plugin));
 			xfdashboard_plugin_enable(plugin);
 		}
 	}
@@ -661,7 +686,9 @@ gboolean xfdashboard_plugins_manager_setup(XfdashboardPluginsManager *self)
 
 		/* Get plugin name */
 		pluginID=*iter;
-		g_debug("Try to load plugin '%s'", pluginID);
+		XFDASHBOARD_DEBUG(self, PLUGINS,
+							"Try to load plugin '%s'",
+							pluginID);
 
 		/* Try to load plugin */
 		if(!_xfdashboard_plugins_manager_load_plugin(self, pluginID, &error))
@@ -678,7 +705,12 @@ gboolean xfdashboard_plugins_manager_setup(XfdashboardPluginsManager *self)
 				error=NULL;
 			}
 		}
-			else g_debug("Loaded plugin '%s'", pluginID);
+			else
+			{
+				XFDASHBOARD_DEBUG(self, PLUGINS,
+									"Loaded plugin '%s'",
+									pluginID);
+			}
 	}
 
 	/* If we get here then initialization was successful so set flag that
diff --git a/libxfdashboard/popup-menu.c b/libxfdashboard/popup-menu.c
index 8bf54b3..aeec0d5 100644
--- a/libxfdashboard/popup-menu.c
+++ b/libxfdashboard/popup-menu.c
@@ -63,6 +63,7 @@
 #include <libxfdashboard/enums.h>
 #include <libxfdashboard/utils.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -584,10 +585,11 @@ static ClutterActor* _xfdashboard_popup_menu_focusable_find_selection(Xfdashboar
 		selection=clutter_actor_get_first_child(CLUTTER_ACTOR(priv->itemsContainer));
 
 		valueName=xfdashboard_get_enum_value_name(XFDASHBOARD_TYPE_SELECTION_TARGET, inDirection);
-		g_debug("No selection at %s, so select first child %s for direction %s",
-				G_OBJECT_TYPE_NAME(self),
-				selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
-				valueName);
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"No selection at %s, so select first child %s for direction %s",
+							G_OBJECT_TYPE_NAME(self),
+							selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
+							valueName);
 		g_free(valueName);
 
 		return(selection);
@@ -648,11 +650,12 @@ static ClutterActor* _xfdashboard_popup_menu_focusable_find_selection(Xfdashboar
 	if(newSelection) selection=newSelection;
 
 	/* Return new selection found */
-	g_debug("Selecting %s at %s for current selection %s in direction %u",
-			selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
-			G_OBJECT_TYPE_NAME(self),
-			inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
-			inDirection);
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Selecting %s at %s for current selection %s in direction %u",
+						selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
+						G_OBJECT_TYPE_NAME(self),
+						inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
+						inDirection);
 
 	return(selection);
 }
@@ -1837,10 +1840,11 @@ void xfdashboard_popup_menu_activate(XfdashboardPopupMenu *self)
 	}
 
 	xfdashboard_window_tracker_monitor_get_geometry(monitor, &monitorX, &monitorY, &monitorWidth, &monitorHeight);
-	g_debug("Pointer is on monitor %d with position at %d,%d and size of %dx%d",
-			xfdashboard_window_tracker_monitor_get_number(monitor),
-			monitorX, monitorY,
-			monitorWidth, monitorHeight);
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Pointer is on monitor %d with position at %d,%d and size of %dx%d",
+						xfdashboard_window_tracker_monitor_get_number(monitor),
+						monitorX, monitorY,
+						monitorWidth, monitorHeight);
 
 	x=pointerX;
 	y=pointerY;
diff --git a/libxfdashboard/quicklaunch.c b/libxfdashboard/quicklaunch.c
index 3330b8f..3599299 100644
--- a/libxfdashboard/quicklaunch.c
+++ b/libxfdashboard/quicklaunch.c
@@ -53,6 +53,7 @@
 #include <libxfdashboard/popup-menu-item-separator.h>
 #include <libxfdashboard/utils.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -178,10 +179,11 @@ static ClutterActor* _xfdashboard_quicklaunch_get_actor_for_appinfo(XfdashboardQ
 	 */
 	if(!XFDASHBOARD_IS_DESKTOP_APP_INFO(inAppInfo))
 	{
-		g_debug("%s is derived from %s but not derived %s",
-					G_OBJECT_TYPE_NAME(inAppInfo),
-					g_type_name(G_TYPE_APP_INFO),
-					g_type_name(XFDASHBOARD_TYPE_DESKTOP_APP_INFO));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"%s is derived from %s but not derived %s",
+							G_OBJECT_TYPE_NAME(inAppInfo),
+							g_type_name(G_TYPE_APP_INFO),
+							g_type_name(XFDASHBOARD_TYPE_DESKTOP_APP_INFO));
 		return(NULL);
 	}
 
@@ -240,10 +242,11 @@ static gboolean _xfdashboard_quicklaunch_has_favourite_appinfo(XfdashboardQuickl
 	 */
 	if(!XFDASHBOARD_IS_DESKTOP_APP_INFO(inAppInfo))
 	{
-		g_debug("%s is derived from %s but not derived %s",
-					G_OBJECT_TYPE_NAME(inAppInfo),
-					g_type_name(G_TYPE_APP_INFO),
-					g_type_name(XFDASHBOARD_TYPE_DESKTOP_APP_INFO));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"%s is derived from %s but not derived %s",
+							G_OBJECT_TYPE_NAME(inAppInfo),
+							g_type_name(G_TYPE_APP_INFO),
+							g_type_name(XFDASHBOARD_TYPE_DESKTOP_APP_INFO));
 		return(TRUE);
 	}
 
@@ -1615,9 +1618,10 @@ static void _xfdashboard_quicklaunch_update_icons_from_property(XfdashboardQuick
 	{
 		currentSelectionAppInfo=xfdashboard_application_button_get_app_info(XFDASHBOARD_APPLICATION_BUTTON(priv->selectedItem));
 
-		g_debug("Going to destroy current selection %p (%s) for desktop ID '%s'",
-					priv->selectedItem, G_OBJECT_TYPE_NAME(priv->selectedItem),
-					g_app_info_get_id(xfdashboard_application_button_get_app_info(XFDASHBOARD_APPLICATION_BUTTON(priv->selectedItem))));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Going to destroy current selection %p (%s) for desktop ID '%s'",
+							priv->selectedItem, G_OBJECT_TYPE_NAME(priv->selectedItem),
+							g_app_info_get_id(xfdashboard_application_button_get_app_info(XFDASHBOARD_APPLICATION_BUTTON(priv->selectedItem))));
 	}
 
 	/* Remove all application buttons */
@@ -1661,9 +1665,10 @@ static void _xfdashboard_quicklaunch_update_icons_from_property(XfdashboardQuick
 			{
 				xfdashboard_focusable_set_selection(XFDASHBOARD_FOCUSABLE(self), actor);
 
-				g_debug("Select newly created actor %p (%s) because it matches desktop ID '%s'",
-							actor, G_OBJECT_TYPE_NAME(actor),
-							g_app_info_get_id(xfdashboard_application_button_get_app_info(XFDASHBOARD_APPLICATION_BUTTON(actor))));
+				XFDASHBOARD_DEBUG(self, ACTOR,
+									"Select newly created actor %p (%s) because it matches desktop ID '%s'",
+									actor, G_OBJECT_TYPE_NAME(actor),
+									g_app_info_get_id(xfdashboard_application_button_get_app_info(XFDASHBOARD_APPLICATION_BUTTON(actor))));
 			}
 		}
 
@@ -2070,17 +2075,19 @@ static gboolean _xfdashboard_quicklaunch_selection_add_favourite(XfdashboardQuic
 	currentSelection=xfdashboard_focusable_get_selection(inSource);
 	if(!currentSelection)
 	{
-		g_debug("Source actor %s has no selection and no favourite can be added.",
-					G_OBJECT_TYPE_NAME(inSource));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Source actor %s has no selection and no favourite can be added.",
+							G_OBJECT_TYPE_NAME(inSource));
 		return(CLUTTER_EVENT_STOP);
 	}
 
 	if(!XFDASHBOARD_IS_APPLICATION_BUTTON(currentSelection))
 	{
-		g_debug("Current selection at source actor %s has type %s but only selections of type %s can be added.",
-					G_OBJECT_TYPE_NAME(inSource),
-					G_OBJECT_TYPE_NAME(currentSelection),
-					g_type_name(XFDASHBOARD_TYPE_APPLICATION_BUTTON));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Current selection at source actor %s has type %s but only selections of type %s can be added.",
+							G_OBJECT_TYPE_NAME(inSource),
+							G_OBJECT_TYPE_NAME(currentSelection),
+							g_type_name(XFDASHBOARD_TYPE_APPLICATION_BUTTON));
 		return(CLUTTER_EVENT_STOP);
 	}
 
@@ -2155,25 +2162,28 @@ static gboolean _xfdashboard_quicklaunch_selection_remove_favourite(XfdashboardQ
 	currentSelection=xfdashboard_focusable_get_selection(inSource);
 	if(!currentSelection)
 	{
-		g_debug("Source actor %s has no selection so no favourite can be removed.",
-					G_OBJECT_TYPE_NAME(inSource));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Source actor %s has no selection so no favourite can be removed.",
+							G_OBJECT_TYPE_NAME(inSource));
 		return(CLUTTER_EVENT_STOP);
 	}
 
 	if(!XFDASHBOARD_IS_APPLICATION_BUTTON(currentSelection))
 	{
-		g_debug("Current selection at source actor %s has type %s but only selections of type %s can be removed.",
-					G_OBJECT_TYPE_NAME(inSource),
-					G_OBJECT_TYPE_NAME(currentSelection),
-					g_type_name(XFDASHBOARD_TYPE_APPLICATION_BUTTON));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Current selection at source actor %s has type %s but only selections of type %s can be removed.",
+							G_OBJECT_TYPE_NAME(inSource),
+							G_OBJECT_TYPE_NAME(currentSelection),
+							g_type_name(XFDASHBOARD_TYPE_APPLICATION_BUTTON));
 		return(CLUTTER_EVENT_STOP);
 	}
 
 	if(priv->dragPreviewIcon && currentSelection==priv->dragPreviewIcon)
 	{
-		g_debug("Current selection at source actor %s is %s which is the drag preview icon which cannot be removed.",
-					G_OBJECT_TYPE_NAME(inSource),
-					G_OBJECT_TYPE_NAME(currentSelection));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Current selection at source actor %s is %s which is the drag preview icon which cannot be removed.",
+							G_OBJECT_TYPE_NAME(inSource),
+							G_OBJECT_TYPE_NAME(currentSelection));
 		return(CLUTTER_EVENT_STOP);
 	}
 
@@ -2250,8 +2260,9 @@ static gboolean _xfdashboard_quicklaunch_favourite_reorder_selection(Xfdashboard
 	 */
 	if(priv->orientation!=orientation)
 	{
-		g_debug("Source actor %s does not have expected orientation.",
-					G_OBJECT_TYPE_NAME(self));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Source actor %s does not have expected orientation.",
+							G_OBJECT_TYPE_NAME(self));
 		return(CLUTTER_EVENT_STOP);
 	}
 
@@ -2259,32 +2270,36 @@ static gboolean _xfdashboard_quicklaunch_favourite_reorder_selection(Xfdashboard
 	currentSelection=xfdashboard_focusable_get_selection(XFDASHBOARD_FOCUSABLE(self));
 	if(!currentSelection)
 	{
-		g_debug("Source actor %s has no selection so no favourite can be reordered.",
-					G_OBJECT_TYPE_NAME(self));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Source actor %s has no selection so no favourite can be reordered.",
+							G_OBJECT_TYPE_NAME(self));
 		return(CLUTTER_EVENT_STOP);
 	}
 
 	if(!XFDASHBOARD_IS_APPLICATION_BUTTON(currentSelection))
 	{
-		g_debug("Current selection at source actor %s has type %s but only selections of type %s can be reordered.",
-					G_OBJECT_TYPE_NAME(self),
-					G_OBJECT_TYPE_NAME(currentSelection),
-					g_type_name(XFDASHBOARD_TYPE_APPLICATION_BUTTON));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Current selection at source actor %s has type %s but only selections of type %s can be reordered.",
+							G_OBJECT_TYPE_NAME(self),
+							G_OBJECT_TYPE_NAME(currentSelection),
+							g_type_name(XFDASHBOARD_TYPE_APPLICATION_BUTTON));
 		return(CLUTTER_EVENT_STOP);
 	}
 
 	if(!xfdashboard_stylable_has_class(XFDASHBOARD_STYLABLE(currentSelection), "favourite-app"))
 	{
-		g_debug("Current selection at source actor %s is not a favourite and cannot be reordered.",
-					G_OBJECT_TYPE_NAME(self));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Current selection at source actor %s is not a favourite and cannot be reordered.",
+							G_OBJECT_TYPE_NAME(self));
 		return(CLUTTER_EVENT_STOP);
 	}
 
 	if(priv->dragPreviewIcon && currentSelection==priv->dragPreviewIcon)
 	{
-		g_debug("Current selection at source actor %s is %s which is the drag preview icon which cannot be reordered.",
-					G_OBJECT_TYPE_NAME(self),
-					G_OBJECT_TYPE_NAME(currentSelection));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Current selection at source actor %s is %s which is the drag preview icon which cannot be reordered.",
+							G_OBJECT_TYPE_NAME(self),
+							G_OBJECT_TYPE_NAME(currentSelection));
 		return(CLUTTER_EVENT_STOP);
 	}
 
@@ -2305,18 +2320,20 @@ static gboolean _xfdashboard_quicklaunch_favourite_reorder_selection(Xfdashboard
 
 	if(!newSelection)
 	{
-		g_debug("Current selection %s at source actor %s is already at end of list",
-					G_OBJECT_TYPE_NAME(currentSelection),
-					G_OBJECT_TYPE_NAME(self));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Current selection %s at source actor %s is already at end of list",
+							G_OBJECT_TYPE_NAME(currentSelection),
+							G_OBJECT_TYPE_NAME(self));
 		return(CLUTTER_EVENT_STOP);
 	}
 
 	if(!XFDASHBOARD_IS_APPLICATION_BUTTON(newSelection))
 	{
-		g_debug("Current selection %s at source actor %s cannot be moved because it is blocked by %s.",
-					G_OBJECT_TYPE_NAME(currentSelection),
-					G_OBJECT_TYPE_NAME(self),
-					G_OBJECT_TYPE_NAME(newSelection));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Current selection %s at source actor %s cannot be moved because it is blocked by %s.",
+							G_OBJECT_TYPE_NAME(currentSelection),
+							G_OBJECT_TYPE_NAME(self),
+							G_OBJECT_TYPE_NAME(newSelection));
 		return(CLUTTER_EVENT_STOP);
 	}
 
@@ -2395,9 +2412,10 @@ static void _xfdashboard_quicklaunch_on_app_tracker_state_changed(XfdashboardQui
 	appInfo=xfdashboard_application_database_lookup_desktop_id(priv->appDB, inDesktopID);
 	if(!appInfo)
 	{
-		g_debug("Unknown desktop ID '%s' changed state to '%s'",
-				inDesktopID,
-				inIsRunning ? "running" : "stopped");
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Unknown desktop ID '%s' changed state to '%s'",
+							inDesktopID,
+							inIsRunning ? "running" : "stopped");
 		return;
 	}
 
@@ -2418,9 +2436,10 @@ static void _xfdashboard_quicklaunch_on_app_tracker_state_changed(XfdashboardQui
 			clutter_actor_show(actor);
 			clutter_actor_add_child(CLUTTER_ACTOR(self), actor);
 
-			g_debug("Created dynamic actor %p for newly running desktop ID '%s'",
-					actor,
-					inDesktopID);
+			XFDASHBOARD_DEBUG(self, ACTOR,
+								"Created dynamic actor %p for newly running desktop ID '%s'",
+								actor,
+								inDesktopID);
 		}
 	}
 
@@ -2436,9 +2455,10 @@ static void _xfdashboard_quicklaunch_on_app_tracker_state_changed(XfdashboardQui
 		if(actor &&
 			xfdashboard_stylable_has_class(XFDASHBOARD_STYLABLE(actor), "dynamic-app"))
 		{
-			g_debug("Destroying dynamic actor %p for stopped desktop ID '%s'",
-					actor,
-					inDesktopID);
+			XFDASHBOARD_DEBUG(self, ACTOR,
+								"Destroying dynamic actor %p for stopped desktop ID '%s'",
+								actor,
+								inDesktopID);
 
 			clutter_actor_destroy(actor);
 		}
@@ -2797,10 +2817,11 @@ static ClutterActor* _xfdashboard_quicklaunch_focusable_find_selection(Xfdashboa
 		selection=clutter_actor_get_first_child(CLUTTER_ACTOR(self));
 
 		valueName=xfdashboard_get_enum_value_name(XFDASHBOARD_TYPE_SELECTION_TARGET, inDirection);
-		g_debug("No selection at %s, so select first child %s for direction %s",
-				G_OBJECT_TYPE_NAME(self),
-				selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
-				valueName);
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"No selection at %s, so select first child %s for direction %s",
+							G_OBJECT_TYPE_NAME(self),
+							selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
+							valueName);
 		g_free(valueName);
 
 		return(selection);
@@ -2913,11 +2934,12 @@ static ClutterActor* _xfdashboard_quicklaunch_focusable_find_selection(Xfdashboa
 	if(newSelection) selection=newSelection;
 
 	/* Return new selection found */
-	g_debug("Selecting %s at %s for current selection %s in direction %u",
-			selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
-			G_OBJECT_TYPE_NAME(self),
-			inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
-			inDirection);
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Selecting %s at %s for current selection %s in direction %u",
+						selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
+						G_OBJECT_TYPE_NAME(self),
+						inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
+						inDirection);
 
 	return(selection);
 }
diff --git a/libxfdashboard/scrollbar.c b/libxfdashboard/scrollbar.c
index 6a0d80c..94583bb 100644
--- a/libxfdashboard/scrollbar.c
+++ b/libxfdashboard/scrollbar.c
@@ -31,6 +31,7 @@
 
 #include <libxfdashboard/stylable.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -321,7 +322,10 @@ static gboolean _xfdashboard_scrollbar_on_scroll_event(ClutterActor *inActor,
 
 		/* Unhandled directions */
 		default:
-			g_debug("Cannot handle scroll direction %d in %s", clutter_event_get_scroll_direction(inEvent), G_OBJECT_TYPE_NAME(self));
+			XFDASHBOARD_DEBUG(self, ACTOR,
+								"Cannot handle scroll direction %d in %s",
+								clutter_event_get_scroll_direction(inEvent),
+								G_OBJECT_TYPE_NAME(self));
 			return(CLUTTER_EVENT_PROPAGATE);
 	}
 
@@ -911,7 +915,11 @@ void xfdashboard_scrollbar_set_value(XfdashboardScrollbar *self, gfloat inValue)
 
 		oldValue=inValue;
 		inValue=MAX(0.0f, priv->range-priv->valueRange);
-		g_debug("Adjusting value %.2f to %.2f in scrollbar to fit into range [0-%.2f]", oldValue, inValue, priv->range);
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Adjusting value %.2f to %.2f in scrollbar to fit into range [0-%.2f]",
+							oldValue,
+							inValue,
+							priv->range);
 		enforceNewValue=TRUE;
 	}
 
@@ -972,10 +980,17 @@ void xfdashboard_scrollbar_set_range(XfdashboardScrollbar *self, gfloat inRange)
 	{
 		gfloat						oldValue;
 
-		g_debug("Adjusting value %.2f in scrollbar to fit into new range %.2f", priv->value, priv->range);
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Adjusting value %.2f in scrollbar to fit into new range %.2f",
+							priv->value,
+							priv->range);
 		oldValue=priv->value;
 		xfdashboard_scrollbar_set_value(self, priv->range);
-		g_debug("Adjusted value %.2f to %.2f in scrollbar to fit into new range %.2f", oldValue, priv->value, priv->range);
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Adjusted value %.2f to %.2f in scrollbar to fit into new range %.2f",
+							oldValue,
+							priv->value,
+							priv->range);
 	}
 
 	/* Thaw notification */
diff --git a/libxfdashboard/search-manager.c b/libxfdashboard/search-manager.c
index c254621..30289f1 100644
--- a/libxfdashboard/search-manager.c
+++ b/libxfdashboard/search-manager.c
@@ -34,6 +34,7 @@
 #include <libxfdashboard/utils.h>
 #include <libxfdashboard/marshal.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -286,9 +287,10 @@ gboolean xfdashboard_search_manager_register(XfdashboardSearchManager *self, con
 	}
 
 	/* Register search provider */
-	g_debug("Registering search provider %s of type %s",
-			inID,
-			g_type_name(inProviderType));
+	XFDASHBOARD_DEBUG(self, MISC,
+						"Registering search provider %s of type %s",
+						inID,
+						g_type_name(inProviderType));
 
 	data=_xfdashboard_search_manager_entry_new(inID, inProviderType);
 	if(!data)
@@ -330,9 +332,10 @@ gboolean xfdashboard_search_manager_unregister(XfdashboardSearchManager *self, c
 	data=(XfdashboardSearchManagerData*)(iter->data);
 
 	/* Remove from list of registered providers */
-	g_debug("Unregistering search provider %s of type %s",
-			data->ID,
-			g_type_name(data->gtype));
+	XFDASHBOARD_DEBUG(self, MISC,
+						"Unregistering search provider %s of type %s",
+						data->ID,
+						g_type_name(data->gtype));
 
 	priv->registeredProviders=g_list_remove_link(priv->registeredProviders, iter);
 	g_signal_emit(self, XfdashboardSearchManagerSignals[SIGNAL_UNREGISTERED], 0, data->ID);
diff --git a/libxfdashboard/search-provider.c b/libxfdashboard/search-provider.c
index 028f7c0..df7ecf2 100644
--- a/libxfdashboard/search-provider.c
+++ b/libxfdashboard/search-provider.c
@@ -32,6 +32,7 @@
 #include <libxfdashboard/actor.h>
 #include <libxfdashboard/text-box.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -68,9 +69,10 @@ static GParamSpec* XfdashboardSearchProviderProperties[PROP_LAST]={ 0, };
 				vfunc);
 
 #define XFDASHBOARD_SEARCH_PROVIDER_NOTE_NOT_IMPLEMENTED(self, vfunc) \
-	g_debug("Search provider of type %s does not implement virtual function XfdashboardSearchProvider::%s", \
-				G_OBJECT_TYPE_NAME(self), \
-				vfunc);
+	XFDASHBOARD_DEBUG(self, MISC,                                              \
+						"Search provider of type %s does not implement virtual function XfdashboardSearchProvider::%s",\
+						G_OBJECT_TYPE_NAME(self),                              \
+						vfunc);
 
 /* Set search provider ID */
 static void _xfdashboard_search_provider_set_id(XfdashboardSearchProvider *self, const gchar *inID)
diff --git a/libxfdashboard/search-result-container.c b/libxfdashboard/search-result-container.c
index c1cc82a..a82d187 100644
--- a/libxfdashboard/search-result-container.c
+++ b/libxfdashboard/search-result-container.c
@@ -42,6 +42,7 @@
 #include <libxfdashboard/drag-action.h>
 #include <libxfdashboard/marshal.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -911,13 +912,14 @@ static ClutterActor* _xfdashboard_search_result_container_find_selection_from_ic
 	if(selection && needsWrap && !inAllowWrap) selection=NULL;
 
 	/* Return new selection */
-	g_debug("Selecting %s in icon mode at %s for current selection %s in direction %u with wrapping %s and wrapping %s",
-			selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
-			G_OBJECT_TYPE_NAME(self),
-			inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
-			inDirection,
-			inAllowWrap ? "allowed" : "denied",
-			needsWrap ? "needed" : "not needed");
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Selecting %s in icon mode at %s for current selection %s in direction %u with wrapping %s and wrapping %s",
+						selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
+						G_OBJECT_TYPE_NAME(self),
+						inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
+						inDirection,
+						inAllowWrap ? "allowed" : "denied",
+						needsWrap ? "needed" : "not needed");
 
 	return(selection);
 }
@@ -1061,13 +1063,14 @@ static ClutterActor* _xfdashboard_search_result_container_find_selection_from_li
 	if(selection && needsWrap && !inAllowWrap) selection=NULL;
 
 	/* Return new selection */
-	g_debug("Selecting %s in list mode at %s for current selection %s in direction %u with wrapping %s and wrapping %s",
-			selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
-			G_OBJECT_TYPE_NAME(self),
-			inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
-			inDirection,
-			inAllowWrap ? "allowed" : "denied",
-			needsWrap ? "needed" : "not needed");
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Selecting %s in list mode at %s for current selection %s in direction %u with wrapping %s and wrapping %s",
+						selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
+						G_OBJECT_TYPE_NAME(self),
+						inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
+						inDirection,
+						inAllowWrap ? "allowed" : "denied",
+						needsWrap ? "needed" : "not needed");
 
 	return(selection);
 }
@@ -1821,9 +1824,10 @@ ClutterActor* xfdashboard_search_result_container_find_selection(XfdashboardSear
 	if(!inSelection)
 	{
 		newSelection=clutter_actor_get_first_child(priv->itemsContainer);
-		g_debug("No selection for %s, so select first child of result container for provider %s",
-				G_OBJECT_TYPE_NAME(self),
-				priv->provider ? G_OBJECT_TYPE_NAME(priv->provider) : "<unknown provider>");
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"No selection for %s, so select first child of result container for provider %s",
+							G_OBJECT_TYPE_NAME(self),
+							priv->provider ? G_OBJECT_TYPE_NAME(priv->provider) : "<unknown provider>");
 
 		return(newSelection);
 	}
@@ -1893,12 +1897,13 @@ ClutterActor* xfdashboard_search_result_container_find_selection(XfdashboardSear
 	if(newSelection) selection=newSelection;
 
 	/* Return new selection found */
-	g_debug("Selecting %s at %s for current selection %s in direction %u with wrapping %s",
-			selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
-			G_OBJECT_TYPE_NAME(self),
-			inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
-			inDirection,
-			inAllowWrap ? "allowed" : "denied");
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Selecting %s at %s for current selection %s in direction %u with wrapping %s",
+						selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
+						G_OBJECT_TYPE_NAME(self),
+						inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
+						inDirection,
+						inAllowWrap ? "allowed" : "denied");
 
 	return(selection);
 }
diff --git a/libxfdashboard/search-view.c b/libxfdashboard/search-view.c
index 5233be4..9486e35 100644
--- a/libxfdashboard/search-view.c
+++ b/libxfdashboard/search-view.c
@@ -59,6 +59,7 @@
 #include <libxfdashboard/enums.h>
 #include <libxfdashboard/application.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -345,9 +346,10 @@ static XfdashboardSearchViewProviderData* _xfdashboard_search_view_get_provider_
 	if(!container)
 	{
 		/* Container for requested child was not found */
-		g_debug("Did not find container for actor %p of type %s",
-					inChild,
-					G_OBJECT_TYPE_NAME(inChild));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Did not find container for actor %p of type %s",
+							inChild,
+							G_OBJECT_TYPE_NAME(inChild));
 
 		return(NULL);
 	}
@@ -391,10 +393,11 @@ static void _xfdashboard_search_view_on_search_provider_registered(XfdashboardSe
 		data=_xfdashboard_search_view_provider_data_new(self, inProviderID);
 		priv->providers=g_list_append(priv->providers, data);
 
-		g_debug("Created search provider %s of type %s in %s",
-					xfdashboard_search_provider_get_name(data->provider),
-					G_OBJECT_TYPE_NAME(data->provider),
-					G_OBJECT_TYPE_NAME(self));
+		XFDASHBOARD_DEBUG(self, MISC,
+							"Created search provider %s of type %s in %s",
+							xfdashboard_search_provider_get_name(data->provider),
+							G_OBJECT_TYPE_NAME(data->provider),
+							G_OBJECT_TYPE_NAME(self));
 	}
 		else _xfdashboard_search_view_provider_data_unref(data);
 }
@@ -417,10 +420,11 @@ static void _xfdashboard_search_view_on_search_provider_unregistered(Xfdashboard
 	data=_xfdashboard_search_view_get_provider_data(self, inProviderID);
 	if(data)
 	{
-		g_debug("Unregistering search provider %s of type %s in %s",
-					xfdashboard_search_provider_get_name(data->provider),
-					G_OBJECT_TYPE_NAME(data->provider),
-					G_OBJECT_TYPE_NAME(self));
+		XFDASHBOARD_DEBUG(self, MISC,
+							"Unregistering search provider %s of type %s in %s",
+							xfdashboard_search_provider_get_name(data->provider),
+							G_OBJECT_TYPE_NAME(data->provider),
+							G_OBJECT_TYPE_NAME(self));
 
 		/* Find data of unregistered search provider in list of
 		 * active search providers to remove it from that list.
@@ -612,11 +616,12 @@ static void _xfdashboard_search_view_on_provider_container_destroyed(ClutterActo
 		 * new selection found and will be set.
 		 */
 		oldSelection=xfdashboard_focusable_get_selection(XFDASHBOARD_FOCUSABLE(self));
-		g_debug("Container of provider %s is destroyed but holds current selection %p of type %s - so selecting %p of type %s of provider %s",
-					providerData->provider ? G_OBJECT_TYPE_NAME(providerData->provider) : "<nil>",
-					oldSelection, oldSelection ? G_OBJECT_TYPE_NAME(oldSelection) : "<nil>",
-					newSelection, newSelection ? G_OBJECT_TYPE_NAME(newSelection) : "<nil>",
-					newSelectionProvider && newSelectionProvider->provider ? G_OBJECT_TYPE_NAME(newSelectionProvider->provider) : "<nil>");
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Container of provider %s is destroyed but holds current selection %p of type %s - so selecting %p of type %s of provider %s",
+							providerData->provider ? G_OBJECT_TYPE_NAME(providerData->provider) : "<nil>",
+							oldSelection, oldSelection ? G_OBJECT_TYPE_NAME(oldSelection) : "<nil>",
+							newSelection, newSelection ? G_OBJECT_TYPE_NAME(newSelection) : "<nil>",
+							newSelectionProvider && newSelectionProvider->provider ? G_OBJECT_TYPE_NAME(newSelectionProvider->provider) : "<nil>");
 
 		xfdashboard_focusable_set_selection(XFDASHBOARD_FOCUSABLE(self), newSelection);
 	}
@@ -847,10 +852,11 @@ static guint _xfdashboard_search_view_perform_search(XfdashboardSearchView *self
 		providerNewResultSet=xfdashboard_search_provider_get_result_set(providerData->provider,
 																		(const gchar**)inSearchTerms->termList,
 																		providerLastResultSet);
-		g_debug("Performed %s search at search provider %s and got %u result items",
-					canDoIncrementalSearch==TRUE ? "incremental" : "full",
-					G_OBJECT_TYPE_NAME(providerData->provider),
-					providerNewResultSet ? xfdashboard_search_result_set_get_size(providerNewResultSet) : 0);
+		XFDASHBOARD_DEBUG(self, MISC,
+							"Performed %s search at search provider %s and got %u result items",
+							canDoIncrementalSearch==TRUE ? "incremental" : "full",
+							G_OBJECT_TYPE_NAME(providerData->provider),
+							providerNewResultSet ? xfdashboard_search_result_set_get_size(providerNewResultSet) : 0);
 
 		/* Count number of results */
 		if(providerNewResultSet) numberResults+=xfdashboard_search_result_set_get_size(providerNewResultSet);
@@ -874,7 +880,10 @@ static guint _xfdashboard_search_view_perform_search(XfdashboardSearchView *self
 
 #ifdef DEBUG
 	/* Get time for this search for debug performance */
-	g_debug("Updating search for '%s' took %f seconds", inSearchTerms->termString, g_timer_elapsed(timer, NULL));
+	XFDASHBOARD_DEBUG(self, MISC,
+						"Updating search for '%s' took %f seconds",
+						inSearchTerms->termString,
+						g_timer_elapsed(timer, NULL));
 	g_timer_destroy(timer);
 #endif
 
@@ -904,9 +913,10 @@ static guint _xfdashboard_search_view_perform_search(XfdashboardSearchView *self
 
 			/* Set new selection */
 			xfdashboard_focusable_set_selection(XFDASHBOARD_FOCUSABLE(self), selection);
-			g_debug("Reselecting selectable item in direction %d at provider %s as old selection vanished",
-					reselectDirection,
-					xfdashboard_search_provider_get_name(reselectProvider->provider));
+			XFDASHBOARD_DEBUG(self, ACTOR,
+								"Reselecting selectable item in direction %d at provider %s as old selection vanished",
+								reselectDirection,
+								xfdashboard_search_provider_get_name(reselectProvider->provider));
 		}
 	}
 
@@ -1351,9 +1361,10 @@ static ClutterActor* _xfdashboard_search_view_focusable_find_selection(Xfdashboa
 			}
 		}
 
-		g_debug("No selection for %s, so select first selectable actor of provider %s",
-					G_OBJECT_TYPE_NAME(self),
-					newSelectionProvider && newSelectionProvider->provider ? G_OBJECT_TYPE_NAME(newSelectionProvider->provider) : "<unknown provider>");
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"No selection for %s, so select first selectable actor of provider %s",
+							G_OBJECT_TYPE_NAME(self),
+							newSelectionProvider && newSelectionProvider->provider ? G_OBJECT_TYPE_NAME(newSelectionProvider->provider) : "<unknown provider>");
 
 		return(newSelection);
 	}
@@ -1382,9 +1393,10 @@ static ClutterActor* _xfdashboard_search_view_focusable_find_selection(Xfdashboa
 			}
 		}
 
-		g_debug("First selection requested at %s, so select first selectable actor of provider %s",
-					G_OBJECT_TYPE_NAME(self),
-					newSelectionProvider && newSelectionProvider->provider ? G_OBJECT_TYPE_NAME(newSelectionProvider->provider) : "<unknown provider>");
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"First selection requested at %s, so select first selectable actor of provider %s",
+							G_OBJECT_TYPE_NAME(self),
+							newSelectionProvider && newSelectionProvider->provider ? G_OBJECT_TYPE_NAME(newSelectionProvider->provider) : "<unknown provider>");
 
 		return(newSelection);
 	}
@@ -1413,9 +1425,10 @@ static ClutterActor* _xfdashboard_search_view_focusable_find_selection(Xfdashboa
 			}
 		}
 
-		g_debug("Last selection requested at %s, so select last selectable actor of provider %s",
-					G_OBJECT_TYPE_NAME(self),
-					newSelectionProvider && newSelectionProvider->provider ? G_OBJECT_TYPE_NAME(newSelectionProvider->provider) : "<unknown provider>");
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Last selection requested at %s, so select last selectable actor of provider %s",
+							G_OBJECT_TYPE_NAME(self),
+							newSelectionProvider && newSelectionProvider->provider ? G_OBJECT_TYPE_NAME(newSelectionProvider->provider) : "<unknown provider>");
 
 		return(newSelection);
 	}
@@ -1426,17 +1439,19 @@ static ClutterActor* _xfdashboard_search_view_focusable_find_selection(Xfdashboa
 	newSelectionProvider=_xfdashboard_search_view_get_provider_data_by_actor(self, inSelection);
 	if(!newSelectionProvider)
 	{
-		g_debug("Could not find provider for selection %p of type %s",
-					inSelection,
-					inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>");
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Could not find provider for selection %p of type %s",
+							inSelection,
+							inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>");
 		return(NULL);
 	}
 
 	currentProviderIter=g_list_find(priv->providers, newSelectionProvider);
 	if(!currentProviderIter)
 	{
-		g_debug("Could not find position of provider %s",
-					newSelectionProvider->provider ? G_OBJECT_TYPE_NAME(newSelectionProvider->provider) : "<unknown provider>");
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Could not find position of provider %s",
+							newSelectionProvider->provider ? G_OBJECT_TYPE_NAME(newSelectionProvider->provider) : "<unknown provider>");
 
 		/* Release allocated resources */
 		_xfdashboard_search_view_provider_data_unref(newSelectionProvider);
diff --git a/libxfdashboard/stage-interface.c b/libxfdashboard/stage-interface.c
index 5608272..76f6f00 100644
--- a/libxfdashboard/stage-interface.c
+++ b/libxfdashboard/stage-interface.c
@@ -34,6 +34,7 @@
 #include <libxfdashboard/stage.h>
 #include <libxfdashboard/stylable.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -94,11 +95,12 @@ static void _xfdashboard_stage_interface_on_geometry_changed(XfdashboardStageInt
 	clutter_actor_set_position(CLUTTER_ACTOR(self), x, y);
 	clutter_actor_set_size(CLUTTER_ACTOR(self), w, h);
 
-	g_debug("Stage interface moved to %d,%d and resized to %dx%d because %s monitor %d changed geometry",
-				x, y,
-				w, h,
-				xfdashboard_window_tracker_monitor_is_primary(priv->monitor) ? "primary" : "non-primary",
-				xfdashboard_window_tracker_monitor_get_number(priv->monitor));
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Stage interface moved to %d,%d and resized to %dx%d because %s monitor %d changed geometry",
+						x, y,
+						w, h,
+						xfdashboard_window_tracker_monitor_is_primary(priv->monitor) ? "primary" : "non-primary",
+						xfdashboard_window_tracker_monitor_get_number(priv->monitor));
 }
 
 /* Monitor changed primary state */
@@ -118,9 +120,10 @@ static void _xfdashboard_stage_interface_on_primary_changed(XfdashboardStageInte
 	if(isPrimary) xfdashboard_stylable_add_class(XFDASHBOARD_STYLABLE(self), "primary-monitor");
 		else xfdashboard_stylable_remove_class(XFDASHBOARD_STYLABLE(self), "primary-monitor");
 
-	g_debug("Stage interface changed primary state to %s because of monitor %d",
-				xfdashboard_window_tracker_monitor_is_primary(priv->monitor) ? "primary" : "non-primary",
-				xfdashboard_window_tracker_monitor_get_number(priv->monitor));
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Stage interface changed primary state to %s because of monitor %d",
+						xfdashboard_window_tracker_monitor_is_primary(priv->monitor) ? "primary" : "non-primary",
+						xfdashboard_window_tracker_monitor_get_number(priv->monitor));
 }
 
 /* IMPLEMENTATION: ClutterActor */
diff --git a/libxfdashboard/stage.c b/libxfdashboard/stage.c
index 55fea2a..7a1d497 100644
--- a/libxfdashboard/stage.c
+++ b/libxfdashboard/stage.c
@@ -53,6 +53,7 @@
 #include <libxfdashboard/window-content.h>
 #include <libxfdashboard/stage-interface.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -575,7 +576,7 @@ static void _xfdashboard_stage_on_window_opened(XfdashboardStage *self,
 	xfdashboard_window_tracker_window_make_stage_window(priv->stageWindow);
 
 	/* Disconnect signal handler as this is a one-time setup of stage window */
-	g_debug("Stage window was opened and set up. Removing signal handler.");
+	XFDASHBOARD_DEBUG(self, ACTOR, "Stage window was opened and set up. Removing signal handler.");
 	g_signal_handlers_disconnect_by_func(priv->windowTracker, G_CALLBACK(_xfdashboard_stage_on_window_opened), self);
 
 	/* Set focus */
@@ -608,7 +609,7 @@ static void _xfdashboard_stage_on_desktop_window_opened(XfdashboardStage *self,
 		g_object_unref(windowContent);
 
 		g_signal_handlers_disconnect_by_func(priv->windowTracker, G_CALLBACK(_xfdashboard_stage_on_desktop_window_opened), self);
-		g_debug("Found desktop window with signal 'window-opened', so disconnecting signal handler");
+		XFDASHBOARD_DEBUG(self, ACTOR, "Found desktop window with signal 'window-opened', so disconnecting signal handler");
 	}
 }
 
@@ -921,7 +922,7 @@ static void _xfdashboard_stage_on_application_theme_changed(XfdashboardStage *se
 			/* Add interface to list of interfaces */
 			interfaces=g_list_prepend(interfaces, interface);
 
-			g_debug("Creating primary interface only because of no support for multiple monitors");
+			XFDASHBOARD_DEBUG(self, ACTOR, "Creating primary interface only because of no support for multiple monitors");
 		}
 
 	/* Destroy all interfaces from stage.
@@ -1138,9 +1139,10 @@ static void _xfdashboard_stage_on_application_theme_changed(XfdashboardStage *se
 				/* Register actor at focus manager */
 				xfdashboard_focus_manager_register(priv->focusManager,
 													XFDASHBOARD_FOCUSABLE(focusObject));
-				g_debug("Registering actor %s of interface with ID '%s' at focus manager",
-						G_OBJECT_TYPE_NAME(focusObject),
-						clutter_actor_get_name(interface));
+				XFDASHBOARD_DEBUG(self, ACTOR,
+									"Registering actor %s of interface with ID '%s' at focus manager",
+									G_OBJECT_TYPE_NAME(focusObject),
+									clutter_actor_get_name(interface));
 			}
 		}
 	}
@@ -1208,9 +1210,10 @@ static void _xfdashboard_stage_on_primary_monitor_changed(XfdashboardStage *self
 
 	/* Set new primary monitor at primary stage interface */
 	xfdashboard_stage_interface_set_monitor(XFDASHBOARD_STAGE_INTERFACE(priv->primaryInterface), inNewMonitor);
-	g_debug("Primary monitor changed from %d to %d",
-				xfdashboard_window_tracker_monitor_get_number(oldPrimaryStageInterfaceMonitor),
-				xfdashboard_window_tracker_monitor_get_number(inNewMonitor));
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Primary monitor changed from %d to %d",
+						xfdashboard_window_tracker_monitor_get_number(oldPrimaryStageInterfaceMonitor),
+						xfdashboard_window_tracker_monitor_get_number(inNewMonitor));
 }
 
 /* A monitor was added */
@@ -1253,8 +1256,9 @@ static void _xfdashboard_stage_on_monitor_added(XfdashboardStage *self,
 
 	/* Add interface to stage */
 	clutter_actor_add_child(CLUTTER_ACTOR(self), interface);
-	g_debug("Added stage interface for new monitor %d",
-				xfdashboard_window_tracker_monitor_get_number(inMonitor));
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Added stage interface for new monitor %d",
+						xfdashboard_window_tracker_monitor_get_number(inMonitor));
 
 	/* If monitor added is the primary monitor then swap now the stage interfaces */
 	if(xfdashboard_window_tracker_monitor_is_primary(inMonitor))
@@ -1308,8 +1312,9 @@ static void _xfdashboard_stage_on_monitor_removed(XfdashboardStage *self,
 		if(xfdashboard_stage_interface_get_monitor(interface)==inMonitor)
 		{
 			clutter_actor_iter_destroy(&childIter);
-			g_debug("Removed stage interface for removed monitor %d",
-						xfdashboard_window_tracker_monitor_get_number(inMonitor));
+			XFDASHBOARD_DEBUG(self, ACTOR,
+								"Removed stage interface for removed monitor %d",
+								xfdashboard_window_tracker_monitor_get_number(inMonitor));
 		}
 	}
 }
@@ -1335,9 +1340,10 @@ static void _xfdashboard_stage_on_screen_size_changed(XfdashboardStage *self,
 	if((gint)stageWidth!=inWidth ||
 		(gint)stageHeight!=inHeight)
 	{
-		g_debug("Screen resized to %dx%d but stage has size of %dx%d - resizing stage",
-					inWidth, inHeight,
-					(gint)stageWidth, (gint)stageHeight);
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Screen resized to %dx%d but stage has size of %dx%d - resizing stage",
+							inWidth, inHeight,
+							(gint)stageWidth, (gint)stageHeight);
 
 		clutter_actor_set_size(CLUTTER_ACTOR(self), inWidth, inHeight);
 	}
@@ -1798,7 +1804,7 @@ static void xfdashboard_stage_init(XfdashboardStage *self)
 									G_CALLBACK(_xfdashboard_stage_on_screen_size_changed),
 									self);
 
-		g_debug("Tracking screen resizes to resize stage");
+		XFDASHBOARD_DEBUG(self, ACTOR, "Tracking screen resizes to resize stage");
 	}
 }
 
@@ -1853,7 +1859,7 @@ void xfdashboard_stage_set_background_image_type(XfdashboardStage *self, Xfdashb
 							clutter_actor_set_content(priv->backgroundImageLayer, backgroundContent);
 							g_object_unref(backgroundContent);
 
-							g_debug("Desktop window was found and set up as background image for stage");
+							XFDASHBOARD_DEBUG(self, ACTOR, "Desktop window was found and set up as background image for stage");
 						}
 							else
 							{
@@ -1861,7 +1867,7 @@ void xfdashboard_stage_set_background_image_type(XfdashboardStage *self, Xfdashb
 															"window-opened",
 															G_CALLBACK(_xfdashboard_stage_on_desktop_window_opened),
 															self);
-								g_debug("Desktop window was not found. Setting up signal to get notified when desktop window might be opened.");
+								XFDASHBOARD_DEBUG(self, ACTOR, "Desktop window was not found. Setting up signal to get notified when desktop window might be opened.");
 							}
 					}
 					break;
diff --git a/libxfdashboard/theme-css.c b/libxfdashboard/theme-css.c
index 8c7c872..36a055f 100644
--- a/libxfdashboard/theme-css.c
+++ b/libxfdashboard/theme-css.c
@@ -39,6 +39,7 @@
 #include <libxfdashboard/stylable.h>
 #include <libxfdashboard/css-selector.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -975,7 +976,9 @@ static gchar* _xfdashboard_theme_css_parse_at_identifier(XfdashboardThemeCSS *se
 		ioScanner->config=scannerConfig;
 
 		/* Function arguments must begin with '('. Check for it and parse function arguments ... */
-		g_debug("Fetching arguments to for calling function '%s'", identifier);
+		XFDASHBOARD_DEBUG(self, THEME,
+							"Fetching arguments to for calling function '%s'",
+							identifier);
 
 		token=g_scanner_get_next_token(ioScanner);
 		if(token==G_TOKEN_LEFT_PAREN)
@@ -1028,10 +1031,11 @@ static gchar* _xfdashboard_theme_css_parse_at_identifier(XfdashboardThemeCSS *se
 								else
 								{
 									error=TRUE;
-									g_debug("Could not resolve '%s' for argument #%d of function '%s'",
-												orginalValue,
-												g_list_length(arguments),
-												identifier);
+									XFDASHBOARD_DEBUG(self, THEME,
+														"Could not resolve '%s' for argument #%d of function '%s'",
+														orginalValue,
+														g_list_length(arguments),
+														identifier);
 								}
 
 							/* Set new scanner config again to parse remaining arguments */
@@ -1058,9 +1062,10 @@ static gchar* _xfdashboard_theme_css_parse_at_identifier(XfdashboardThemeCSS *se
 						{
 							/* Add function argument to list of arguments */
 							arguments=g_list_append(arguments, arg);
-							g_debug("Added argument #%d: '%s'",
-										g_list_length(arguments),
-										arg);
+							XFDASHBOARD_DEBUG(self, THEME,
+												"Added argument #%d: '%s'",
+												g_list_length(arguments),
+												arg);
 
 							/* Prepare for next argument */
 							arg=NULL;
@@ -1141,9 +1146,10 @@ static gchar* _xfdashboard_theme_css_parse_at_identifier(XfdashboardThemeCSS *se
 			{
 				/* Add function argument to list of arguments */
 				arguments=g_list_append(arguments, arg);
-				g_debug("Added final argument #%d: '%s'",
-							g_list_length(arguments),
-							arg);
+				XFDASHBOARD_DEBUG(self, THEME,
+									"Added final argument #%d: '%s'",
+									g_list_length(arguments),
+									arg);
 
 				/* Does not make sense but just in case - prepare for next argument ;) */
 				arg=NULL;
@@ -1191,7 +1197,10 @@ static gchar* _xfdashboard_theme_css_parse_at_identifier(XfdashboardThemeCSS *se
 			/* Initialize for function call */
 			functionError=NULL;
 
-			g_debug("Calling registered function %s with %d arguments", identifier, g_list_length(arguments));
+			XFDASHBOARD_DEBUG(self, THEME,
+								"Calling registered function %s with %d arguments",
+								identifier,
+								g_list_length(arguments));
 			functionSuccess=(functionCallback)(self, identifier, arguments, &functionValue, &functionError);
 			if(functionSuccess)
 			{
@@ -1225,16 +1234,21 @@ static gchar* _xfdashboard_theme_css_parse_at_identifier(XfdashboardThemeCSS *se
 				g_value_unset(&stringValue);
 				g_value_unset(&functionValue);
 
-				g_debug("Calling function %s with %d arguments succeeded with result: %s", identifier, g_list_length(arguments), result);
+				XFDASHBOARD_DEBUG(self, THEME,
+									"Calling function %s with %d arguments succeeded with result: %s",
+									identifier,
+									g_list_length(arguments),
+									result);
 			}
 				else
 				{
 					gchar		*message;
 
-					g_debug("Calling function %s with %d arguments failed: %s",
-								identifier,
-								g_list_length(arguments),
-								(functionError && functionError->message) ? functionError->message : _("Unknown error"));
+					XFDASHBOARD_DEBUG(self, THEME,
+										"Calling function %s with %d arguments failed: %s",
+										identifier,
+										g_list_length(arguments),
+										(functionError && functionError->message) ? functionError->message : _("Unknown error"));
 
 					/* Set error message */
 					if(functionError && functionError->message)
@@ -1406,12 +1420,17 @@ static gchar* _xfdashboard_theme_css_resolve_at_identifier_internal(XfdashboardT
 		/* Call ourselve recursive (via _xfdashboard_theme_css_resolve_at_identifier_by_string)
 		 * to resolve any '@' identifier which might be in value resolved this time.
 		 */
-		g_debug("Resolving css value '%s'", value);
+		XFDASHBOARD_DEBUG(self, THEME,
+							"Resolving css value '%s'",
+							value);
 		resolvedValue=_xfdashboard_theme_css_resolve_at_identifier_by_string(self,
 																				value,
 																				inScopeScanner,
 																				inScopeSelectors);
-		g_debug("Resolved css value '%s' to '%s' recursively", value, resolvedValue);
+		XFDASHBOARD_DEBUG(self, THEME,
+							"Resolved css value '%s' to '%s' recursively",
+							value,
+							resolvedValue);
 
 		/* Release old value and new one */
 		g_free(value);
@@ -1621,12 +1640,17 @@ static GTokenType _xfdashboard_theme_css_parse_css_key_value(XfdashboardThemeCSS
 		gchar		*resolvedValue;
 
 		/* Resolve value */
-		g_debug("Resolving css value '%s'", *outValue);
+		XFDASHBOARD_DEBUG(self, THEME,
+							"Resolving css value '%s'",
+							*outValue);
 		resolvedValue=_xfdashboard_theme_css_resolve_at_identifier_by_string(self,
 																				*outValue,
 																				inScanner,
 																				inScopeSelectors);
-		g_debug("Resolved css value '%s' to '%s'", *outValue, resolvedValue);
+		XFDASHBOARD_DEBUG(self, THEME,
+							"Resolved css value '%s' to '%s'",
+							*outValue,
+							resolvedValue);
 
 		/* Release old value and set new one */
 		g_free(*outValue);
@@ -1853,10 +1877,11 @@ static GTokenType _xfdashboard_theme_css_command_import(XfdashboardThemeCSS *sel
 			tempFilename=g_build_filename(cssPath, filename, NULL);
 			if(g_file_test(tempFilename, G_FILE_TEST_EXISTS))
 			{
-				g_debug("Resolved relative path '%s' to import to '%s' which is relative to current css file '%s'.",
-							filename,
-							tempFilename,
-							inScanner->input_name);
+				XFDASHBOARD_DEBUG(self, THEME,
+									"Resolved relative path '%s' to import to '%s' which is relative to current css file '%s'.",
+									filename,
+									tempFilename,
+									inScanner->input_name);
 
 				g_free(filename);
 				filename=g_strdup(tempFilename);
@@ -1875,10 +1900,11 @@ static GTokenType _xfdashboard_theme_css_command_import(XfdashboardThemeCSS *sel
 		{
 			tempFilename=g_build_filename(priv->themePath, filename, NULL);
 
-			g_debug("Resolved relative path '%s' to import to '%s' which is relative to theme path '%s'.",
-						filename,
-						tempFilename,
-						priv->themePath);
+			XFDASHBOARD_DEBUG(self, THEME,
+								"Resolved relative path '%s' to import to '%s' which is relative to theme path '%s'.",
+								filename,
+								tempFilename,
+								priv->themePath);
 
 			g_free(filename);
 			filename=g_strdup(tempFilename);
@@ -1922,7 +1948,9 @@ static GTokenType _xfdashboard_theme_css_command_import(XfdashboardThemeCSS *sel
 		return(G_TOKEN_ERROR);
 	}
 
-	g_debug("Imported CSS file '%s'", filename);
+	XFDASHBOARD_DEBUG(self, THEME,
+						"Imported CSS file '%s'",
+						filename);
 
 	/* Correct line offset */
 	priv->offsetLine-=oldLineOffset;
@@ -2616,19 +2644,21 @@ gboolean xfdashboard_theme_css_add_file(XfdashboardThemeCSS *self,
 	if(selectors)
 	{
 		priv->selectors=g_list_concat(priv->selectors, selectors);
-		g_debug("Successfully parsed '%s' and added %d selectors - total %d selectors",
-					inPath,
-					g_list_length(selectors),
-					g_list_length(priv->selectors));
+		XFDASHBOARD_DEBUG(self, THEME,
+							"Successfully parsed '%s' and added %d selectors - total %d selectors",
+							inPath,
+							g_list_length(selectors),
+							g_list_length(priv->selectors));
 	}
 
 	if(styles)
 	{
 		priv->styles=g_list_concat(priv->styles, styles);
-		g_debug("Successfully parsed '%s' and added %d styles - total %d styles",
-					inPath,
-					g_list_length(styles),
-					g_list_length(priv->styles));
+		XFDASHBOARD_DEBUG(self, THEME,
+							"Successfully parsed '%s' and added %d styles - total %d styles",
+							inPath,
+							g_list_length(styles),
+							g_list_length(priv->styles));
 	}
 
 	/* Release allocated resources */
@@ -2674,7 +2704,9 @@ GHashTable* xfdashboard_theme_css_get_properties(XfdashboardThemeCSS *self,
 									(styleID) ? styleID : "",
 									(stylePseudoClasses) ? ":" : "",
 									(stylePseudoClasses) ? stylePseudoClasses : "");
-	g_debug("Looking up matches for %s ", styleSelector);
+	XFDASHBOARD_DEBUG(self, STYLE,
+						"Looking up matches for %s ",
+						styleSelector);
 
 	timer=g_timer_new();
 #endif
@@ -2728,10 +2760,11 @@ GHashTable* xfdashboard_theme_css_get_properties(XfdashboardThemeCSS *self,
 	g_list_free(matches);
 
 #ifdef DEBUG
-	g_debug("Found %u properties for %s in %f seconds" ,
-				g_hash_table_size(result),
-				styleSelector,
-				g_timer_elapsed(timer, NULL));
+	XFDASHBOARD_DEBUG(self, STYLE,
+						"Found %u properties for %s in %f seconds" ,
+						g_hash_table_size(result),
+						styleSelector,
+						g_timer_elapsed(timer, NULL));
 	g_timer_destroy(timer);
 	g_free(styleSelector);
 #endif
diff --git a/libxfdashboard/theme-effects.c b/libxfdashboard/theme-effects.c
index 7c60242..f4522d1 100644
--- a/libxfdashboard/theme-effects.c
+++ b/libxfdashboard/theme-effects.c
@@ -33,6 +33,7 @@
 
 #include <libxfdashboard/utils.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -470,9 +471,10 @@ static ClutterEffect* _xfdashboard_theme_effects_create_object(XfdashboardThemeE
 
 	if(!object)
 	{
-		g_debug("Failed to create object of type %s with %d properties to set",
-					g_type_name(inObjectData->classType),
-					collectData.maxProperties);
+		XFDASHBOARD_DEBUG(NULL, THEME,
+							"Failed to create object of type %s with %d properties to set",
+							g_type_name(inObjectData->classType),
+							collectData.maxProperties);
 
 		/* Return NULL indicating error */
 		return(NULL);
@@ -607,7 +609,11 @@ static void _xfdashboard_theme_effects_parse_property_text_node(GMarkupParseCont
 
 	/* Store value for property */
 	g_hash_table_insert(objectData->properties, g_strdup(data->lastPropertyName), g_strdup(inText));
-	g_debug("Setting property '%s' to value '%s' at object with id '%s' of type %s", data->lastPropertyName, inText, objectData->id, g_type_name(objectData->classType));
+	XFDASHBOARD_DEBUG(data->self, THEME,
+						"Setting property '%s' to value '%s' at object with id '%s' of type %s",
+						data->lastPropertyName,
+						inText,
+						objectData->id, g_type_name(objectData->classType));
 
 	/* The property's value is set now so do not remember its name anymore */
 	g_free(data->lastPropertyName);
@@ -770,10 +776,11 @@ static void _xfdashboard_theme_effects_parse_object_end(GMarkupParseContext *inC
 		}
 
 		g_hash_table_insert(objectData->properties, g_strdup(data->lastPropertyName), "");
-		g_debug("Adding property '%s' with empty value to object with id '%s' of type %s",
-					data->lastPropertyName,
-					objectData->id,
-					g_type_name(objectData->classType));
+		XFDASHBOARD_DEBUG(data->self, THEME,
+							"Adding property '%s' with empty value to object with id '%s' of type %s",
+							data->lastPropertyName,
+							objectData->id,
+							g_type_name(objectData->classType));
 		g_free(data->lastPropertyName);
 		data->lastPropertyName=NULL;
 	}
@@ -1121,7 +1128,9 @@ static gboolean _xfdashboard_theme_effects_parse_xml(XfdashboardThemeEffects *se
 	{
 		g_slist_foreach(data->effects, (GFunc)_xfdashboard_theme_effects_print_parsed_objects, "Effects (this file):");
 		g_slist_foreach(self->priv->effects, (GFunc)_xfdashboard_theme_effects_print_parsed_objects, "Effects (parsed before):");
-		g_debug("PARSER ERROR: %s", (outError && *outError) ? (*outError)->message : "unknown error");
+		XFDASHBOARD_DEBUG(self, THEME,
+							"PARSER ERROR: %s",
+							(outError && *outError) ? (*outError)->message : "unknown error");
 	}
 #endif
 
diff --git a/libxfdashboard/theme-layout.c b/libxfdashboard/theme-layout.c
index 972e237..7d0799b 100644
--- a/libxfdashboard/theme-layout.c
+++ b/libxfdashboard/theme-layout.c
@@ -33,6 +33,7 @@
 
 #include <libxfdashboard/utils.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -587,11 +588,12 @@ static void _xfdashboard_theme_layout_create_object_resolve_unresolved(Xfdashboa
 								unresolvedID->property->tag.property.name,
 								refObject,
 								NULL);
-				g_debug("Set previously unresolved object %s with ID '%s' at target object %s at property '%s'",
-							refObject ? G_OBJECT_TYPE_NAME(refObject) : "<unknown object>",
-							unresolvedID->property->tag.property.refID,
-							unresolvedID->targetObject ? G_OBJECT_TYPE_NAME(unresolvedID->targetObject) : "<unknown object>",
-							unresolvedID->property->tag.property.name);
+				XFDASHBOARD_DEBUG(self, THEME,
+									"Set previously unresolved object %s with ID '%s' at target object %s at property '%s'",
+									refObject ? G_OBJECT_TYPE_NAME(refObject) : "<unknown object>",
+									unresolvedID->property->tag.property.refID,
+									unresolvedID->targetObject ? G_OBJECT_TYPE_NAME(unresolvedID->targetObject) : "<unknown object>",
+									unresolvedID->property->tag.property.name);
 				break;
 
 			case TAG_FOCUS:
@@ -610,10 +612,11 @@ static void _xfdashboard_theme_layout_create_object_resolve_unresolved(Xfdashboa
 				}
 				g_ptr_array_add(focusTable, refObject);
 
-				g_debug("Added resolved focusable actor %s with reference ID '%s' to focusable list at target object %s ",
-							refObject ? G_OBJECT_TYPE_NAME(refObject) : "<unknown object>",
-							unresolvedID->property->tag.focus.refID,
-							unresolvedID->targetObject ? G_OBJECT_TYPE_NAME(unresolvedID->targetObject) : "<unknown object>");
+				XFDASHBOARD_DEBUG(self, THEME,
+									"Added resolved focusable actor %s with reference ID '%s' to focusable list at target object %s ",
+									refObject ? G_OBJECT_TYPE_NAME(refObject) : "<unknown object>",
+									unresolvedID->property->tag.focus.refID,
+									unresolvedID->targetObject ? G_OBJECT_TYPE_NAME(unresolvedID->targetObject) : "<unknown object>");
 				break;
 
 			default:
@@ -685,13 +688,19 @@ static GObject* _xfdashboard_theme_layout_create_object(XfdashboardThemeLayout *
 
 	if(!object)
 	{
-		g_debug("Failed to create object of type %s with %d properties to set", g_type_name(inObjectData->classType), usedProperties);
+		XFDASHBOARD_DEBUG(self, THEME,
+							"Failed to create object of type %s with %d properties to set",
+							g_type_name(inObjectData->classType),
+							usedProperties);
 
 		/* Return NULL indicating error */
 		return(NULL);
 	}
 
-	g_debug("Created object %p of type %s", object, G_OBJECT_TYPE_NAME(object));
+	XFDASHBOARD_DEBUG(self, THEME,
+						"Created object %p of type %s",
+						object,
+						G_OBJECT_TYPE_NAME(object));
 
 	/* If object created has an ID and is derived from ClutterActor
 	 * then set ID as name of actor if name was not set by any property.
@@ -707,9 +716,10 @@ static GObject* _xfdashboard_theme_layout_create_object(XfdashboardThemeLayout *
 			if(!name || strlen(name)==0)
 			{
 				g_object_set(object, "name", inObjectData->id, NULL);
-				g_debug("Object %s has ID but no name, setting ID '%s' as name",
-							G_OBJECT_TYPE_NAME(object),
-							inObjectData->id);
+				XFDASHBOARD_DEBUG(self, THEME,
+									"Object %s has ID but no name, setting ID '%s' as name",
+									G_OBJECT_TYPE_NAME(object),
+									inObjectData->id);
 			}
 			if(name) g_free(name);
 		}
@@ -731,13 +741,16 @@ static GObject* _xfdashboard_theme_layout_create_object(XfdashboardThemeLayout *
 		{
 			if(child)
 			{
-				g_debug("Child %s is not an actor and cannot be added to actor %s",
-							G_OBJECT_TYPE_NAME(child),
-							G_OBJECT_TYPE_NAME(object));
+				XFDASHBOARD_DEBUG(self, THEME,
+									"Child %s is not an actor and cannot be added to actor %s",
+									G_OBJECT_TYPE_NAME(child),
+									G_OBJECT_TYPE_NAME(object));
 			}
 				else
 				{
-					g_debug("Failed to create child for actor %s", G_OBJECT_TYPE_NAME(object));
+					XFDASHBOARD_DEBUG(self, THEME,
+										"Failed to create child for actor %s",
+										G_OBJECT_TYPE_NAME(object));
 				}
 
 			/* Release allocated resources */
@@ -751,9 +764,10 @@ static GObject* _xfdashboard_theme_layout_create_object(XfdashboardThemeLayout *
 		/* Add successfully created child actor to this actor */
 		if(childObjectData->id) g_hash_table_insert(ioIDs, g_strdup(childObjectData->id), child);
 		clutter_actor_add_child(CLUTTER_ACTOR(object), CLUTTER_ACTOR(child));
-		g_debug("Created child %s and added to object %s",
-					G_OBJECT_TYPE_NAME(child),
-					G_OBJECT_TYPE_NAME(object));
+		XFDASHBOARD_DEBUG(self, THEME,
+							"Created child %s and added to object %s",
+							G_OBJECT_TYPE_NAME(child),
+							G_OBJECT_TYPE_NAME(object));
 	}
 
 	/* Create layout */
@@ -770,13 +784,16 @@ static GObject* _xfdashboard_theme_layout_create_object(XfdashboardThemeLayout *
 		{
 			if(layout)
 			{
-				g_debug("Layout %s is not a layout manager and cannot be set at actor %s",
-							G_OBJECT_TYPE_NAME(layout),
-							G_OBJECT_TYPE_NAME(object));
+				XFDASHBOARD_DEBUG(self, THEME,
+									"Layout %s is not a layout manager and cannot be set at actor %s",
+									G_OBJECT_TYPE_NAME(layout),
+									G_OBJECT_TYPE_NAME(object));
 			}
 				else
 				{
-					g_debug("Failed to create layout manager for actor %s", G_OBJECT_TYPE_NAME(object));
+					XFDASHBOARD_DEBUG(self, THEME,
+										"Failed to create layout manager for actor %s",
+										G_OBJECT_TYPE_NAME(object));
 				}
 
 			/* Release allocated resources */
@@ -790,9 +807,10 @@ static GObject* _xfdashboard_theme_layout_create_object(XfdashboardThemeLayout *
 		/* Add successfully created child actor to this actor */
 		if(layoutObjectData->id) g_hash_table_insert(ioIDs, g_strdup(layoutObjectData->id), layout);
 		clutter_actor_set_layout_manager(CLUTTER_ACTOR(object), CLUTTER_LAYOUT_MANAGER(layout));
-		g_debug("Created layout manager %s and set at object %s",
-					G_OBJECT_TYPE_NAME(layout),
-					G_OBJECT_TYPE_NAME(object));
+		XFDASHBOARD_DEBUG(self, THEME,
+							"Created layout manager %s and set at object %s",
+							G_OBJECT_TYPE_NAME(layout),
+							G_OBJECT_TYPE_NAME(object));
 	}
 
 	/* Create constraints */
@@ -809,13 +827,16 @@ static GObject* _xfdashboard_theme_layout_create_object(XfdashboardThemeLayout *
 		{
 			if(constraint)
 			{
-				g_debug("Constraint %s is not a constraint and cannot be added to actor %s",
-							G_OBJECT_TYPE_NAME(constraint),
-							G_OBJECT_TYPE_NAME(object));
+				XFDASHBOARD_DEBUG(self, THEME,
+									"Constraint %s is not a constraint and cannot be added to actor %s",
+									G_OBJECT_TYPE_NAME(constraint),
+									G_OBJECT_TYPE_NAME(object));
 			}
 				else
 				{
-					g_debug("Failed to create constraint for actor %s", G_OBJECT_TYPE_NAME(object));
+					XFDASHBOARD_DEBUG(self, THEME,
+										"Failed to create constraint for actor %s",
+										G_OBJECT_TYPE_NAME(object));
 				}
 
 			/* Release allocated resources */
@@ -829,9 +850,10 @@ static GObject* _xfdashboard_theme_layout_create_object(XfdashboardThemeLayout *
 		/* Add successfully created constraint to this actor */
 		if(constraintObjectData->id) g_hash_table_insert(ioIDs, g_strdup(constraintObjectData->id), constraint);
 		clutter_actor_add_constraint(CLUTTER_ACTOR(object), CLUTTER_CONSTRAINT(constraint));
-		g_debug("Created constraint %s and added to object %s",
-					G_OBJECT_TYPE_NAME(constraint),
-					G_OBJECT_TYPE_NAME(object));
+		XFDASHBOARD_DEBUG(self, THEME,
+							"Created constraint %s and added to object %s",
+							G_OBJECT_TYPE_NAME(constraint),
+							G_OBJECT_TYPE_NAME(object));
 	}
 
 	/* Set up properties which do reference other objects */
@@ -1507,11 +1529,12 @@ static void _xfdashboard_theme_layout_parse_general_end(GMarkupParseContext *inC
 		/* Add property to object */
 		objectData=(XfdashboardThemeLayoutParsedObject*)g_queue_peek_tail(data->stackObjects);
 		objectData->properties=g_slist_append(objectData->properties, _xfdashboard_theme_layout_tag_data_ref(subTagData));
-		g_debug("Adding property '%s' with %s '%s' to object %s",
-					subTagData->tag.property.name,
-					subTagData->tag.property.refID ? "referenced object of ID" : "value",
-					subTagData->tag.property.refID ? subTagData->tag.property.refID : subTagData->tag.property.value,
-					g_type_name(objectData->classType));
+		XFDASHBOARD_DEBUG(data->self, THEME,
+							"Adding property '%s' with %s '%s' to object %s",
+							subTagData->tag.property.name,
+							subTagData->tag.property.refID ? "referenced object of ID" : "value",
+							subTagData->tag.property.refID ? subTagData->tag.property.refID : subTagData->tag.property.value,
+							g_type_name(objectData->classType));
 
 		/* Restore previous parser context */
 		g_markup_parse_context_pop(inContext);
@@ -1524,8 +1547,9 @@ static void _xfdashboard_theme_layout_parse_general_end(GMarkupParseContext *inC
 
 		/* Add focusable actor to parser data */
 		g_ptr_array_add(data->focusables, _xfdashboard_theme_layout_tag_data_ref(subTagData));
-		g_debug("Adding focusable actor referenced by ID '%s' to parser data",
-					subTagData->tag.focus.refID);
+		XFDASHBOARD_DEBUG(data->self, THEME,
+							"Adding focusable actor referenced by ID '%s' to parser data",
+							subTagData->tag.focus.refID);
 	}
 
 	/* Handle end of element <interface> */
@@ -1538,9 +1562,10 @@ static void _xfdashboard_theme_layout_parse_general_end(GMarkupParseContext *inC
 			g_assert(!data->interface->focusables);
 
 			data->interface->focusables=g_ptr_array_ref(data->focusables);
-			g_debug("Will resolve %d focusable actor IDs to interface '%s'",
-						data->interface->focusables->len,
-						data->interface->id);
+			XFDASHBOARD_DEBUG(data->self, THEME,
+								"Will resolve %d focusable actor IDs to interface '%s'",
+								data->interface->focusables->len,
+								data->interface->id);
 		}
 	}
 
@@ -1576,11 +1601,15 @@ static void _xfdashboard_theme_layout_check_refids(gpointer inData, gpointer inU
 			!g_hash_table_lookup_extended(ids, property->tag.property.refID, NULL, &value))
 		{
 			g_hash_table_insert(ids, property->tag.property.refID, GINT_TO_POINTER(1));
-			g_debug("Could not resolve referenced ID '%s', set counter to 1", property->tag.property.refID);
+			XFDASHBOARD_DEBUG(NULL, THEME,
+								"Could not resolve referenced ID '%s', set counter to 1",
+								property->tag.property.refID);
 		}
 			else if(property->tag.property.refID)
 			{
-				g_debug("Referenced ID '%s' resolved successfully", property->tag.property.refID);
+				XFDASHBOARD_DEBUG(NULL, THEME,
+									"Referenced ID '%s' resolved successfully",
+									property->tag.property.refID);
 			}
 	}
 
@@ -1616,7 +1645,9 @@ static void _xfdashboard_theme_layout_check_ids(gpointer inData, gpointer inUser
 		if(!g_hash_table_lookup_extended(ids, object->id, NULL, &value))
 		{
 			g_hash_table_insert(ids, object->id, GINT_TO_POINTER(1));
-			g_debug("First occurence of ID '%s', set counter to 1", object->id);
+			XFDASHBOARD_DEBUG(NULL, THEME,
+								"First occurence of ID '%s', set counter to 1",
+								object->id);
 		}
 			/* ... otherwise increase value of key */
 			else
@@ -1626,7 +1657,10 @@ static void _xfdashboard_theme_layout_check_ids(gpointer inData, gpointer inUser
 				count=GPOINTER_TO_INT(value);
 				count++;
 				g_hash_table_replace(ids, object->id, GINT_TO_POINTER(count));
-				g_debug("Found ID '%s' and increased counter to %d", object->id, count);
+				XFDASHBOARD_DEBUG(NULL, THEME,
+									"Found ID '%s' and increased counter to %d",
+									object->id,
+									count);
 			}
 	}
 
@@ -1872,7 +1906,9 @@ static gboolean _xfdashboard_theme_layout_parse_xml(XfdashboardThemeLayout *self
 	if(!success)
 	{
 		g_slist_foreach(priv->interfaces, (GFunc)_xfdashboard_theme_layout_print_parsed_objects, "Interface:");
-		g_debug("PARSER ERROR: %s", outError ? (*outError)->message : "unknown error");
+		XFDASHBOARD_DEBUG(self, THEME,
+							"PARSER ERROR: %s",
+							outError ? (*outError)->message : "unknown error");
 	}
 #endif
 
@@ -2018,7 +2054,9 @@ ClutterActor* xfdashboard_theme_layout_build_interface(XfdashboardThemeLayout *s
 	 */
 	if(!interfaceData)
 	{
-		g_debug("Could not find object data for interface '%s'", inID);
+		XFDASHBOARD_DEBUG(self, THEME,
+							"Could not find object data for interface '%s'",
+							inID);
 		return(NULL);
 	}
 
@@ -2037,12 +2075,20 @@ ClutterActor* xfdashboard_theme_layout_build_interface(XfdashboardThemeLayout *s
 	actor=CLUTTER_ACTOR(_xfdashboard_theme_layout_create_object(self, interfaceData, ids, &unresolved));
 	if(actor)
 	{
-		g_debug("Created actor %s for interface '%s'", G_OBJECT_TYPE_NAME(actor), inID);
+		XFDASHBOARD_DEBUG(self, THEME,
+							"Created actor %s for interface '%s'",
+							G_OBJECT_TYPE_NAME(actor),
+							inID);
 
 		/* Resolved unresolved properties of newly created object */
 		_xfdashboard_theme_layout_create_object_resolve_unresolved(self, ids, unresolved);
 	}
-		else g_debug("Failed to create actor for interface '%s'", inID);
+		else
+		{
+			XFDASHBOARD_DEBUG(self, THEME,
+								"Failed to create actor for interface '%s'",
+								inID);
+		}
 
 	/* Release allocated resources */
 	if(ids) g_hash_table_destroy(ids);
diff --git a/libxfdashboard/theme.c b/libxfdashboard/theme.c
index 262185e..8415bd1 100644
--- a/libxfdashboard/theme.c
+++ b/libxfdashboard/theme.c
@@ -33,6 +33,7 @@
 #include <gio/gio.h>
 
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -360,7 +361,9 @@ static gchar* _xfdashboard_theme_lookup_path_for_theme(XfdashboardTheme *self,
 		if(envPath)
 		{
 			themeFile=g_build_filename(envPath, XFDASHBOARD_THEME_FILE, NULL);
-			g_debug("Trying theme file: %s", themeFile);
+			XFDASHBOARD_DEBUG(self, THEME,
+								"Trying theme file: %s",
+								themeFile);
 			if(!g_file_test(themeFile, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
 			{
 				g_free(themeFile);
@@ -373,7 +376,9 @@ static gchar* _xfdashboard_theme_lookup_path_for_theme(XfdashboardTheme *self,
 	if(!themeFile)
 	{
 		themeFile=g_build_filename(g_get_user_data_dir(), "themes", inThemeName, XFDASHBOARD_THEME_SUBPATH, XFDASHBOARD_THEME_FILE, NULL);
-		g_debug("Trying theme file: %s", themeFile);
+		XFDASHBOARD_DEBUG(self, THEME,
+							"Trying theme file: %s",
+							themeFile);
 		if(!g_file_test(themeFile, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
 		{
 			g_free(themeFile);
@@ -390,7 +395,9 @@ static gchar* _xfdashboard_theme_lookup_path_for_theme(XfdashboardTheme *self,
 		if(homeDirectory)
 		{
 			themeFile=g_build_filename(homeDirectory, ".themes", inThemeName, XFDASHBOARD_THEME_SUBPATH, XFDASHBOARD_THEME_FILE, NULL);
-			g_debug("Trying theme file: %s", themeFile);
+			XFDASHBOARD_DEBUG(self, THEME,
+								"Trying theme file: %s",
+								themeFile);
 			if(!g_file_test(themeFile, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
 			{
 				g_free(themeFile);
@@ -403,7 +410,9 @@ static gchar* _xfdashboard_theme_lookup_path_for_theme(XfdashboardTheme *self,
 	if(!themeFile)
 	{
 		themeFile=g_build_filename(PACKAGE_DATADIR, "themes", inThemeName, XFDASHBOARD_THEME_SUBPATH, XFDASHBOARD_THEME_FILE, NULL);
-		g_debug("Trying theme file: %s", themeFile);
+		XFDASHBOARD_DEBUG(self, THEME,
+							"Trying theme file: %s",
+							themeFile);
 		if(!g_file_test(themeFile, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
 		{
 			g_free(themeFile);
diff --git a/libxfdashboard/utils.c b/libxfdashboard/utils.c
index 81ee309..ed198ad 100644
--- a/libxfdashboard/utils.c
+++ b/libxfdashboard/utils.c
@@ -47,6 +47,8 @@
 #include <libxfdashboard/window-tracker.h>
 #include <libxfdashboard/application.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
+
 
 /* Gobject type for pointer arrays (GPtrArray) */
 GType xfdashboard_pointer_array_get_type(void)
@@ -288,8 +290,10 @@ static void _xfdashboard_gvalue_transform_string_enum(const GValue *inSourceValu
 		else
 		{
 			ioDestValue->data[0].v_int=0;
-			g_debug("Cannot get value for unknown enum '%s' for type %s",
-						value, g_type_name(G_VALUE_TYPE(ioDestValue)));
+			XFDASHBOARD_DEBUG(NULL, MISC,
+								"Cannot get value for unknown enum '%s' for type %s",
+								value,
+								g_type_name(G_VALUE_TYPE(ioDestValue)));
 		}
 
 	/* Release allocated resources */
@@ -324,8 +328,10 @@ static void _xfdashboard_gvalue_transform_string_flags(const GValue *inSourceVal
 		if(flagsValue) finalValue|=flagsValue->value;
 			else
 			{
-				g_debug("Cannot get value for unknown flag '%s' for type %s",
-							*entry, g_type_name(G_VALUE_TYPE(ioDestValue)));
+				XFDASHBOARD_DEBUG(NULL, MISC,
+									"Cannot get value for unknown flag '%s' for type %s",
+									*entry,
+									g_type_name(G_VALUE_TYPE(ioDestValue)));
 			}
 
 		/* Continue with next entry */
diff --git a/libxfdashboard/view-manager.c b/libxfdashboard/view-manager.c
index 3c72a8e..abbc99b 100644
--- a/libxfdashboard/view-manager.c
+++ b/libxfdashboard/view-manager.c
@@ -32,6 +32,7 @@
 #include <libxfdashboard/view.h>
 #include <libxfdashboard/utils.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -281,9 +282,10 @@ gboolean xfdashboard_view_manager_register(XfdashboardViewManager *self, const g
 	}
 
 	/* Register view */
-	g_debug("Registering view %s of type %s",
-			inID,
-			g_type_name(inViewType));
+	XFDASHBOARD_DEBUG(self, MISC,
+						"Registering view %s of type %s",
+						inID,
+						g_type_name(inViewType));
 
 	data=_xfdashboard_view_manager_entry_new(inID, inViewType);
 	if(!data)
@@ -325,9 +327,10 @@ gboolean xfdashboard_view_manager_unregister(XfdashboardViewManager *self, const
 	data=(XfdashboardViewManagerData*)(iter->data);
 
 	/* Remove from list of registered views */
-	g_debug("Unregistering view %s of type %s",
-			data->ID,
-			g_type_name(data->gtype));
+	XFDASHBOARD_DEBUG(self, MISC,
+						"Unregistering view %s of type %s",
+						data->ID,
+						g_type_name(data->gtype));
 
 	priv->registeredViews=g_list_remove_link(priv->registeredViews, iter);
 	g_signal_emit(self, XfdashboardViewManagerSignals[SIGNAL_UNREGISTERED], 0, data->ID);
diff --git a/libxfdashboard/viewpad.c b/libxfdashboard/viewpad.c
index 95496e2..09ed30c 100644
--- a/libxfdashboard/viewpad.c
+++ b/libxfdashboard/viewpad.c
@@ -38,6 +38,7 @@
 #include <libxfdashboard/focusable.h>
 #include <libxfdashboard/focus-manager.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -269,7 +270,9 @@ static void _xfdashboard_viewpad_activate_view(XfdashboardViewpad *self, Xfdashb
 		if(hasFocus)
 		{
 			xfdashboard_focusable_unset_focus(XFDASHBOARD_FOCUSABLE(priv->activeView));
-			g_debug("Unset focus from view '%s' because it is the active view at viewpad", xfdashboard_view_get_name(priv->activeView));
+			XFDASHBOARD_DEBUG(self, ACTOR,
+								"Unset focus from view '%s' because it is the active view at viewpad",
+								xfdashboard_view_get_name(priv->activeView));
 		}
 
 		/* Hide current view and emit signal before and after deactivation */
@@ -277,7 +280,9 @@ static void _xfdashboard_viewpad_activate_view(XfdashboardViewpad *self, Xfdashb
 		g_signal_emit_by_name(priv->activeView, "deactivating");
 
 		clutter_actor_hide(CLUTTER_ACTOR(priv->activeView));
-		g_debug("Deactivated view %s", G_OBJECT_TYPE_NAME(priv->activeView));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Deactivated view %s",
+							G_OBJECT_TYPE_NAME(priv->activeView));
 
 		g_signal_emit_by_name(priv->activeView, "deactivated");
 		g_signal_emit(self, XfdashboardViewpadSignals[SIGNAL_VIEW_DEACTIVATED], 0, priv->activeView);
@@ -309,7 +314,9 @@ static void _xfdashboard_viewpad_activate_view(XfdashboardViewpad *self, Xfdashb
 		xfdashboard_scrollbar_set_value(XFDASHBOARD_SCROLLBAR(priv->vScrollbar), y);
 		_xfdashboard_viewpad_update_view_viewport(self);
 		clutter_actor_show(CLUTTER_ACTOR(priv->activeView));
-		g_debug("Activated view %s", G_OBJECT_TYPE_NAME(priv->activeView));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Activated view %s",
+							G_OBJECT_TYPE_NAME(priv->activeView));
 
 		g_signal_handlers_unblock_by_func(priv->hScrollbar, _xfdashboard_viewpad_on_scrollbar_value_changed, self);
 		g_signal_handlers_unblock_by_func(priv->vScrollbar, _xfdashboard_viewpad_on_scrollbar_value_changed, self);
@@ -321,7 +328,9 @@ static void _xfdashboard_viewpad_activate_view(XfdashboardViewpad *self, Xfdashb
 		if(hasFocus)
 		{
 			xfdashboard_focus_manager_set_focus(focusManager, XFDASHBOARD_FOCUSABLE(priv->activeView));
-			g_debug("The previous active view at viewpad had focus so set focus to new active view '%s'", xfdashboard_view_get_name(priv->activeView));
+			XFDASHBOARD_DEBUG(self, ACTOR,
+								"The previous active view at viewpad had focus so set focus to new active view '%s'",
+								xfdashboard_view_get_name(priv->activeView));
 		}
 	}
 
@@ -336,8 +345,9 @@ static void _xfdashboard_viewpad_activate_view(XfdashboardViewpad *self, Xfdashb
 		if(newFocusable)
 		{
 			xfdashboard_focus_manager_set_focus(focusManager, newFocusable);
-			g_debug("Viewpad has focus but no view is active so move focus to next focusable actor of type '%s'",
-					G_OBJECT_TYPE_NAME(newFocusable));
+			XFDASHBOARD_DEBUG(self, ACTOR,
+								"Viewpad has focus but no view is active so move focus to next focusable actor of type '%s'",
+								G_OBJECT_TYPE_NAME(newFocusable));
 		}
 	}
 
@@ -386,10 +396,11 @@ static void _xfdashboard_viewpad_on_view_disabled(XfdashboardViewpad *self, Xfda
 		/* Now activate the first activatable view we found during iteration.
 		 * It can also be no view (NULL pointer).
 		 */
-		g_debug("Disabled view %s was the active view in %s - will activate %s",
-					G_OBJECT_TYPE_NAME(inView),
-					G_OBJECT_TYPE_NAME(self),
-					firstActivatableView ? G_OBJECT_TYPE_NAME(firstActivatableView) : "no other view");
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Disabled view %s was the active view in %s - will activate %s",
+							G_OBJECT_TYPE_NAME(inView),
+							G_OBJECT_TYPE_NAME(self),
+							firstActivatableView ? G_OBJECT_TYPE_NAME(firstActivatableView) : "no other view");
 		_xfdashboard_viewpad_activate_view(self, firstActivatableView);
 	}
 }
@@ -692,7 +703,9 @@ static void _xfdashboard_viewpad_add_view(XfdashboardViewpad *self, const gchar
 	priv=self->priv;
 
 	/* Create instance and check if it is a view */
-	g_debug("Creating view %s for viewpad", inID);
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Creating view %s for viewpad",
+						inID);
 
 	view=xfdashboard_view_manager_create_view(priv->viewManager, inID);
 	if(view==NULL)
diff --git a/libxfdashboard/window-content.c b/libxfdashboard/window-content.c
index 3d4f354..d5b7ff1 100644
--- a/libxfdashboard/window-content.c
+++ b/libxfdashboard/window-content.c
@@ -47,6 +47,7 @@
 #include <libxfdashboard/window-tracker.h>
 #include <libxfdashboard/enums.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Definitions */
@@ -198,8 +199,9 @@ static void _xfdashboard_window_content_destroy_resume_queue(void)
 	/* Disconnect application "shutdown" signal handler */
 	if(_xfdashboard_window_content_resume_shutdown_signal_id)
 	{
-		g_debug("Disconnecting shutdown signal handler %u because of resume queue destruction",
-					_xfdashboard_window_content_resume_shutdown_signal_id);
+		XFDASHBOARD_DEBUG(NULL, WINDOWS,
+							"Disconnecting shutdown signal handler %u because of resume queue destruction",
+							_xfdashboard_window_content_resume_shutdown_signal_id);
 
 		application=xfdashboard_application_get_default();
 		g_signal_handler_disconnect(application, _xfdashboard_window_content_resume_shutdown_signal_id);
@@ -209,8 +211,9 @@ static void _xfdashboard_window_content_destroy_resume_queue(void)
 	/* Remove idle source if available */
 	if(_xfdashboard_window_content_resume_idle_id)
 	{
-		g_debug("Removing resume window content idle source with ID %u",
-					_xfdashboard_window_content_resume_idle_id);
+		XFDASHBOARD_DEBUG(NULL, WINDOWS,
+							"Removing resume window content idle source with ID %u",
+							_xfdashboard_window_content_resume_idle_id);
 
 		g_source_remove(_xfdashboard_window_content_resume_idle_id);
 		_xfdashboard_window_content_resume_idle_id=0;
@@ -239,7 +242,7 @@ static void _xfdashboard_window_content_destroy_resume_queue(void)
 		}
 #endif
 
-		g_debug("Destroying window content resume queue");
+		XFDASHBOARD_DEBUG(NULL, WINDOWS, "Destroying window content resume queue");
 		g_list_free(_xfdashboard_window_content_resume_idle_queue);
 		_xfdashboard_window_content_resume_idle_queue=NULL;
 	}
@@ -267,9 +270,10 @@ static void _xfdashboard_window_content_resume_on_idle_remove(XfdashboardWindowC
 		{
 			/* Remove window content from queue */
 			_xfdashboard_window_content_resume_idle_queue=g_list_delete_link(_xfdashboard_window_content_resume_idle_queue, queueEntry);
-			g_debug("Removed queue entry %p for window '%s' because of releasing resources",
-						queueEntry,
-						xfdashboard_window_tracker_window_get_title(priv->window));
+			XFDASHBOARD_DEBUG(self, WINDOWS,
+								"Removed queue entry %p for window '%s' because of releasing resources",
+								queueEntry,
+								xfdashboard_window_tracker_window_get_title(priv->window));
 		}
 	}
 
@@ -277,8 +281,9 @@ static void _xfdashboard_window_content_resume_on_idle_remove(XfdashboardWindowC
 	if(!_xfdashboard_window_content_resume_idle_queue &&
 		_xfdashboard_window_content_resume_idle_id)
 	{
-		g_debug("Removing idle source with ID %u because queue is empty",
-					_xfdashboard_window_content_resume_idle_id);
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"Removing idle source with ID %u because queue is empty",
+							_xfdashboard_window_content_resume_idle_id);
 
 		g_source_remove(_xfdashboard_window_content_resume_idle_id);
 		_xfdashboard_window_content_resume_idle_id=0;
@@ -294,14 +299,19 @@ static void _xfdashboard_window_content_resume_on_idle_add(XfdashboardWindowCont
 
 	priv=self->priv;
 
-	g_debug("Using resume on idle for window '%s'", xfdashboard_window_tracker_window_get_title(priv->window));
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Using resume on idle for window '%s'",
+						xfdashboard_window_tracker_window_get_title(priv->window));
 
 	/* Only add callback to resume window content if no one was added */
 	if(!g_list_find(_xfdashboard_window_content_resume_idle_queue, self))
 	{
 		/* Queue window content for resume */
 		_xfdashboard_window_content_resume_idle_queue=g_list_append(_xfdashboard_window_content_resume_idle_queue, self);
-		g_debug("Queued window resume of '%s'@%p", xfdashboard_window_tracker_window_get_title(priv->window), self);
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"Queued window resume of '%s'@%p",
+							xfdashboard_window_tracker_window_get_title(priv->window),
+							self);
 	}
 
 	/* Create idle source for resuming queued window contents but with
@@ -314,11 +324,12 @@ static void _xfdashboard_window_content_resume_on_idle_add(XfdashboardWindowCont
 																				_xfdashboard_window_content_resume_on_idle,
 																				NULL,
 																				NULL);
-		g_debug("Created idle source with ID %u with priority of %d because of new resume queue created for window resume of '%s'@%p",
-					_xfdashboard_window_content_resume_idle_id,
-					_xfdashboard_window_content_window_creation_priority,
-					xfdashboard_window_tracker_window_get_title(priv->window),
-					self);
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"Created idle source with ID %u with priority of %d because of new resume queue created for window resume of '%s'@%p",
+							_xfdashboard_window_content_resume_idle_id,
+							_xfdashboard_window_content_window_creation_priority,
+							xfdashboard_window_tracker_window_get_title(priv->window),
+							self);
 	}
 
 	/* Connect to "shutdown" signal of application to clean up resume queue */
@@ -331,8 +342,9 @@ static void _xfdashboard_window_content_resume_on_idle_add(XfdashboardWindowCont
 																				"shutdown-final",
 																				G_CALLBACK(_xfdashboard_window_content_destroy_resume_queue),
 																				NULL);
-		g_debug("Connected to shutdown signal with handler ID %u for resume queue destruction",
-					_xfdashboard_window_content_resume_shutdown_signal_id);
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"Connected to shutdown signal with handler ID %u for resume queue destruction",
+							_xfdashboard_window_content_resume_shutdown_signal_id);
 	}
 }
 
@@ -370,9 +382,10 @@ static void _xfdashboard_window_content_on_window_creation_priority_value_change
 	if(found)
 	{
 		_xfdashboard_window_content_window_creation_priority=found->priority;
-		g_debug("Setting window creation priority to '%s' with priority of %d",
-				found->name,
-				found->priority);
+		XFDASHBOARD_DEBUG(NULL, WINDOWS,
+							"Setting window creation priority to '%s' with priority of %d",
+							found->name,
+							found->priority);
 	}
 }
 
@@ -384,8 +397,9 @@ static void _xfdashboard_window_content_on_window_creation_priority_shutdown(voi
 	/* Disconnect application "shutdown" signal handler */
 	if(_xfdashboard_window_content_window_creation_shutdown_signal_id)
 	{
-		g_debug("Disconnecting shutdown signal handler %u for window creation priority value change notifications",
-					_xfdashboard_window_content_window_creation_shutdown_signal_id);
+		XFDASHBOARD_DEBUG(NULL, WINDOWS,
+							"Disconnecting shutdown signal handler %u for window creation priority value change notifications",
+							_xfdashboard_window_content_window_creation_shutdown_signal_id);
 
 		application=xfdashboard_application_get_default();
 		g_signal_handler_disconnect(application, _xfdashboard_window_content_window_creation_shutdown_signal_id);
@@ -397,8 +411,9 @@ static void _xfdashboard_window_content_on_window_creation_priority_shutdown(voi
 	{
 		XfconfChannel					*xfconfChannel;
 
-		g_debug("Disconnecting property changed signal handler %u for window creation priority value change notifications",
-					_xfdashboard_window_content_xfconf_priority_notify_id);
+		XFDASHBOARD_DEBUG(NULL, WINDOWS,
+							"Disconnecting property changed signal handler %u for window creation priority value change notifications",
+							_xfdashboard_window_content_xfconf_priority_notify_id);
 
 		xfconfChannel=xfdashboard_application_get_xfconf_channel(NULL);
 		g_signal_handler_disconnect(xfconfChannel, _xfdashboard_window_content_xfconf_priority_notify_id);
@@ -803,11 +818,16 @@ static void _xfdashboard_window_content_release_resources(XfdashboardWindowConte
 	trapError=clutter_x11_untrap_x_errors();
 	if(trapError!=0)
 	{
-		g_debug("X error %d occured while releasing resources for window '%s", trapError, xfdashboard_window_tracker_window_get_title(priv->window));
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"X error %d occured while releasing resources for window '%s",
+							trapError,
+							xfdashboard_window_tracker_window_get_title(priv->window));
 		return;
 	}
 
-	g_debug("Released resources for window '%s' to handle live texture updates", xfdashboard_window_tracker_window_get_title(priv->window));
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Released resources for window '%s' to handle live texture updates",
+						xfdashboard_window_tracker_window_get_title(priv->window));
 }
 
 /* Suspend from handling live updates */
@@ -869,11 +889,16 @@ static void _xfdashboard_window_content_suspend(XfdashboardWindowContent *self)
 	trapError=clutter_x11_untrap_x_errors();
 	if(trapError!=0)
 	{
-		g_debug("X error %d occured while suspending '%s", trapError, xfdashboard_window_tracker_window_get_title(priv->window));
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"X error %d occured while suspending '%s",
+							trapError,
+							xfdashboard_window_tracker_window_get_title(priv->window));
 		return;
 	}
 
-	g_debug("Successfully suspended live texture updates for window '%s'", xfdashboard_window_tracker_window_get_title(priv->window));
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Successfully suspended live texture updates for window '%s'",
+						xfdashboard_window_tracker_window_get_title(priv->window));
 }
 
 /* Resume to handle live window updates */
@@ -901,7 +926,7 @@ static gboolean _xfdashboard_window_content_resume_on_idle(gpointer inUserData)
 		/* Queue must be empty but ensure it will */
 		if(_xfdashboard_window_content_resume_idle_queue)
 		{
-			g_debug("Ensuring that window content resume queue is empty");
+			XFDASHBOARD_DEBUG(NULL, WINDOWS, "Ensuring that window content resume queue is empty");
 			g_list_free(_xfdashboard_window_content_resume_idle_queue);
 			_xfdashboard_window_content_resume_idle_queue=NULL;
 		}
@@ -913,15 +938,17 @@ static gboolean _xfdashboard_window_content_resume_on_idle(gpointer inUserData)
 
 	self=XFDASHBOARD_WINDOW_CONTENT(queueEntry->data);
 	priv=self->priv;
-	g_debug("Entering idle source with ID %u for window resume of '%s'@%p",
-				_xfdashboard_window_content_resume_idle_id,
-				xfdashboard_window_tracker_window_get_title(priv->window),
-				self);
-
-	g_debug("Removing queued entry %p for window resume of '%s'@%p",
-				queueEntry,
-				xfdashboard_window_tracker_window_get_title(priv->window),
-				self);
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Entering idle source with ID %u for window resume of '%s'@%p",
+						_xfdashboard_window_content_resume_idle_id,
+						xfdashboard_window_tracker_window_get_title(priv->window),
+						self);
+
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Removing queued entry %p for window resume of '%s'@%p",
+						queueEntry,
+						xfdashboard_window_tracker_window_get_title(priv->window),
+						self);
 	_xfdashboard_window_content_resume_idle_queue=g_list_delete_link(_xfdashboard_window_content_resume_idle_queue, queueEntry);
 	if(_xfdashboard_window_content_resume_idle_queue)
 	{
@@ -929,8 +956,9 @@ static gboolean _xfdashboard_window_content_resume_on_idle(gpointer inUserData)
 	}
 		else
 		{
-			g_debug("Resume idle source with ID %u will be remove because queue is empty",
-						_xfdashboard_window_content_resume_idle_id);
+			XFDASHBOARD_DEBUG(self, WINDOWS,
+								"Resume idle source with ID %u will be remove because queue is empty",
+								_xfdashboard_window_content_resume_idle_id);
 
 			doContinueSource=G_SOURCE_REMOVE;
 			_xfdashboard_window_content_resume_idle_id=0;
@@ -979,9 +1007,10 @@ static gboolean _xfdashboard_window_content_resume_on_idle(gpointer inUserData)
 			/* Creating texture may fail if window is _NOT_ on active workspace
 			 * so display error message just as debug message (this time)
 			 */
-			g_debug("Could not create texture for window '%s': %s",
-						xfdashboard_window_tracker_window_get_title(priv->window),
-						error ? error->message : _("Unknown error"));
+			XFDASHBOARD_DEBUG(self, WINDOWS,
+								"Could not create texture for window '%s': %s",
+								xfdashboard_window_tracker_window_get_title(priv->window),
+								error ? error->message : _("Unknown error"));
 			if(error)
 			{
 				g_error_free(error);
@@ -1064,11 +1093,16 @@ static gboolean _xfdashboard_window_content_resume_on_idle(gpointer inUserData)
 	trapError=clutter_x11_untrap_x_errors();
 	if(trapError!=0)
 	{
-		g_debug("X error %d occured while resuming window '%s", trapError, xfdashboard_window_tracker_window_get_title(priv->window));
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"X error %d occured while resuming window '%s",
+							trapError,
+							xfdashboard_window_tracker_window_get_title(priv->window));
 		return(doContinueSource);
 	}
 
-	g_debug("Resuming live texture updates for window '%s'", xfdashboard_window_tracker_window_get_title(priv->window));
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Resuming live texture updates for window '%s'",
+						xfdashboard_window_tracker_window_get_title(priv->window));
 	return(doContinueSource);
 }
 
@@ -1134,9 +1168,10 @@ static void _xfdashboard_window_content_resume(XfdashboardWindowContent *self)
 			/* Creating texture may fail if window is _NOT_ on active workspace
 			 * so display error message just as debug message (this time)
 			 */
-			g_debug("Could not create texture for window '%s': %s",
-						xfdashboard_window_tracker_window_get_title(priv->window),
-						error ? error->message : _("Unknown error"));
+			XFDASHBOARD_DEBUG(self, WINDOWS,
+								"Could not create texture for window '%s': %s",
+								xfdashboard_window_tracker_window_get_title(priv->window),
+								error ? error->message : _("Unknown error"));
 			if(error)
 			{
 				g_error_free(error);
@@ -1209,11 +1244,16 @@ static void _xfdashboard_window_content_resume(XfdashboardWindowContent *self)
 	trapError=clutter_x11_untrap_x_errors();
 	if(trapError!=0)
 	{
-		g_debug("X error %d occured while resuming window '%s", trapError, xfdashboard_window_tracker_window_get_title(priv->window));
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"X error %d occured while resuming window '%s",
+							trapError,
+							xfdashboard_window_tracker_window_get_title(priv->window));
 		return;
 	}
 
-	g_debug("Resuming live texture updates for window '%s'", xfdashboard_window_tracker_window_get_title(priv->window));
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Resuming live texture updates for window '%s'",
+						xfdashboard_window_tracker_window_get_title(priv->window));
 }
 
 /* Find X window for window frame of given X window content */
@@ -1244,8 +1284,9 @@ static Window _xfdashboard_window_content_get_window_frame_xid(Display *inDispla
 		if(gdk_window_get_decorations(gdkWindow, &gdkWindowDecoration) &&
 			gdkWindowDecoration==0)
 		{
-			g_debug("Window '%s' has CSD enabled and no decorations so skip finding window frame.",
-					xfdashboard_window_tracker_window_get_title(inWindow));
+			XFDASHBOARD_DEBUG(inWindow, WINDOWS,
+								"Window '%s' has CSD enabled and no decorations so skip finding window frame.",
+								xfdashboard_window_tracker_window_get_title(inWindow));
 
 			/* Release allocated resources */
 			g_object_unref(gdkWindow);
@@ -1257,8 +1298,9 @@ static Window _xfdashboard_window_content_get_window_frame_xid(Display *inDispla
 	}
 		else
 		{
-			g_debug("Could not get window decoration fro window '%s'",
-						xfdashboard_window_tracker_window_get_title(inWindow));
+			XFDASHBOARD_DEBUG(inWindow, WINDOWS,
+								"Could not get window decoration fro window '%s'",
+								xfdashboard_window_tracker_window_get_title(inWindow));
 		}
 
 	/* Iterate through X window tree list upwards until root window reached.
@@ -1463,7 +1505,7 @@ static void _xfdashboard_window_content_destroy_cache(void)
 	}
 #endif
 
-	g_debug("Destroying window content cache hashtable");
+	XFDASHBOARD_DEBUG(NULL, WINDOWS, "Destroying window content cache hashtable");
 	g_hash_table_destroy(_xfdashboard_window_content_cache);
 	_xfdashboard_window_content_cache=NULL;
 }
@@ -1478,7 +1520,7 @@ static void _xfdashboard_window_content_create_cache(void)
 
 	/* Create create hashtable */
 	_xfdashboard_window_content_cache=g_hash_table_new(g_direct_hash, g_direct_equal);
-	g_debug("Created window content cache hashtable");
+	XFDASHBOARD_DEBUG(NULL, WINDOWS, "Created window content cache hashtable");
 
 	/* Connect to "shutdown" signal of application to clean up hashtable */
 	application=xfdashboard_application_get_default();
@@ -1871,9 +1913,10 @@ static void _xfdashboard_window_content_dispose(GObject *inObject)
 	if(priv->window)
 	{
 		/* Remove from cache */
-		g_debug("Removing window content for window '%s' with ref-count %d" ,
-					xfdashboard_window_tracker_window_get_title(priv->window),
-					G_OBJECT(self)->ref_count);
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"Removing window content for window '%s' with ref-count %d" ,
+							xfdashboard_window_tracker_window_get_title(priv->window),
+							G_OBJECT(self)->ref_count);
 		g_hash_table_remove(_xfdashboard_window_content_cache, priv->window);
 
 		/* Disconnect signals */
@@ -2248,16 +2291,18 @@ void xfdashboard_window_content_init(XfdashboardWindowContent *self)
 																				G_CALLBACK(_xfdashboard_window_content_on_window_creation_priority_value_changed),
 																				NULL);
 		if(detailedSignal) g_free(detailedSignal);
-		g_debug("Connected to property changed signal with handler ID %u for xfconf value change notifications",
-					_xfdashboard_window_content_xfconf_priority_notify_id);
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"Connected to property changed signal with handler ID %u for xfconf value change notifications",
+							_xfdashboard_window_content_xfconf_priority_notify_id);
 
 		/* Connect to application shutdown signal for xfconf value change notification */
 		_xfdashboard_window_content_window_creation_shutdown_signal_id=g_signal_connect(app,
 																				"shutdown-final",
 																				G_CALLBACK(_xfdashboard_window_content_on_window_creation_priority_shutdown),
 																				NULL);
-		g_debug("Connected to shutdown signal with handler ID %u for xfconf value change notifications",
-					_xfdashboard_window_content_window_creation_shutdown_signal_id);
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"Connected to shutdown signal with handler ID %u for xfconf value change notifications",
+							_xfdashboard_window_content_window_creation_shutdown_signal_id);
 	}
 }
 
@@ -2278,9 +2323,10 @@ ClutterContent* xfdashboard_window_content_new_for_window(XfdashboardWindowTrack
 	{
 		content=CLUTTER_CONTENT(g_hash_table_lookup(_xfdashboard_window_content_cache, inWindow));
 		g_object_ref(content);
-		g_debug("Using cached window content for '%s' - ref-count is now %d" ,
-					xfdashboard_window_tracker_window_get_title(XFDASHBOARD_WINDOW_CONTENT(content)->priv->window),
-					G_OBJECT(content)->ref_count);
+		XFDASHBOARD_DEBUG(content, WINDOWS,
+							"Using cached window content for '%s' - ref-count is now %d" ,
+							xfdashboard_window_tracker_window_get_title(XFDASHBOARD_WINDOW_CONTENT(content)->priv->window),
+							G_OBJECT(content)->ref_count);
 
 		return(content);
 	}
@@ -2296,9 +2342,10 @@ ClutterContent* xfdashboard_window_content_new_for_window(XfdashboardWindowTrack
 
 	/* Store new window content into cache */
 	g_hash_table_insert(_xfdashboard_window_content_cache, inWindow, content);
-	g_debug("Added window content for '%s' with ref-count %d" ,
-				xfdashboard_window_tracker_window_get_title(inWindow),
-				G_OBJECT(content)->ref_count);
+	XFDASHBOARD_DEBUG(content, WINDOWS,
+						"Added window content for '%s' with ref-count %d" ,
+						xfdashboard_window_tracker_window_get_title(inWindow),
+						G_OBJECT(content)->ref_count);
 
 	return(content);
 }
diff --git a/libxfdashboard/window-tracker-monitor.c b/libxfdashboard/window-tracker-monitor.c
index 92f280f..ea83f8e 100644
--- a/libxfdashboard/window-tracker-monitor.c
+++ b/libxfdashboard/window-tracker-monitor.c
@@ -34,6 +34,7 @@
 #include <gdk/gdkx.h>
 
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -102,10 +103,11 @@ static void _xfdashboard_window_tracker_monitor_update_primary(XfdashboardWindow
 	/* Set value if changed */
 	if(priv->isPrimary!=isPrimary)
 	{
-		g_debug("Monitor %d changes primary state from %s to %s",
-					priv->monitorIndex,
-					priv->isPrimary ? "yes" : "no",
-					isPrimary ? "yes" : "no");
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"Monitor %d changes primary state from %s to %s",
+							priv->monitorIndex,
+							priv->isPrimary ? "yes" : "no",
+							isPrimary ? "yes" : "no");
 
 		/* Set value */
 		priv->isPrimary=isPrimary;
@@ -148,10 +150,11 @@ static void _xfdashboard_window_tracker_monitor_update_geometry(XfdashboardWindo
 
 		/* Emit signal */
 		g_signal_emit(self, XfdashboardWindowTrackerMonitorSignals[SIGNAL_GEOMETRY_CHANGED], 0);
-		g_debug("Monitor %d moved to %d,%d and resized to %dx%d",
-					priv->monitorIndex,
-					priv->geometry.x, priv->geometry.y,
-					priv->geometry.width, priv->geometry.height);
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"Monitor %d moved to %d,%d and resized to %dx%d",
+							priv->monitorIndex,
+							priv->geometry.x, priv->geometry.y,
+							priv->geometry.width, priv->geometry.height);
 	}
 }
 
diff --git a/libxfdashboard/window-tracker-window.c b/libxfdashboard/window-tracker-window.c
index 97ed109..ef0975f 100644
--- a/libxfdashboard/window-tracker-window.c
+++ b/libxfdashboard/window-tracker-window.c
@@ -46,6 +46,7 @@
 #include <libxfdashboard/window-tracker.h>
 #include <libxfdashboard/marshal.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Usually we would define a class in GObject system here but
@@ -78,7 +79,7 @@ static void _xfdashboard_window_tracker_window_on_screen_size_changed(Xfdashboar
 
 	stageWindow=WNCK_WINDOW(inUserData);
 
-	g_debug("Set fullscreen across all monitors using Xinerama");
+	XFDASHBOARD_DEBUG(inWindowTracker, WINDOWS, "Set fullscreen across all monitors using Xinerama");
 
 	/* If window manager does not support fullscreen across all monitors
 	 * return here.
@@ -133,12 +134,13 @@ static void _xfdashboard_window_tracker_window_on_screen_size_changed(Xfdashboar
 	topIndex=bottomIndex=leftIndex=rightIndex=0;
 	for(i=0; i<monitorsCount; i++)
 	{
-		g_debug("Checking edges at monitor %d with upper-left at %d,%d and lower-right at %d,%d [size: %dx%d]",
-					i,
-					monitors[i].x_org,
-					monitors[i].y_org,
-					monitors[i].x_org+monitors[i].width, monitors[i].y_org+monitors[i].height,
-					monitors[i].width, monitors[i].height);
+		XFDASHBOARD_DEBUG(inWindowTracker, WINDOWS,
+							"Checking edges at monitor %d with upper-left at %d,%d and lower-right at %d,%d [size: %dx%d]",
+							i,
+							monitors[i].x_org,
+							monitors[i].y_org,
+							monitors[i].x_org+monitors[i].width, monitors[i].y_org+monitors[i].height,
+							monitors[i].width, monitors[i].height);
 
 		if(left>monitors[i].x_org)
 		{
@@ -164,11 +166,12 @@ static void _xfdashboard_window_tracker_window_on_screen_size_changed(Xfdashboar
 			bottomIndex=i;
 		}
 	}
-	g_debug("Found edge monitors: left=%d (monitor %d), right=%d (monitor %d), top=%d (monitor %d), bottom=%d (monitor %d)",
-				left, leftIndex,
-				right, rightIndex,
-				top, topIndex,
-				bottom, bottomIndex);
+	XFDASHBOARD_DEBUG(inWindowTracker, WINDOWS,
+						"Found edge monitors: left=%d (monitor %d), right=%d (monitor %d), top=%d (monitor %d), bottom=%d (monitor %d)",
+						left, leftIndex,
+						right, rightIndex,
+						top, topIndex,
+						bottom, bottomIndex);
 
 	/* Get X atom for fullscreen-across-all-monitors */
 	atomFullscreenMonitors=XInternAtom(GDK_DISPLAY_XDISPLAY(display),
@@ -206,7 +209,7 @@ static void _xfdashboard_window_tracker_window_on_screen_size_changed(Xfdashboar
 
 	stageWindow=WNCK_WINDOW(inUserData);
 
-	g_debug("No support for multiple monitor: Setting fullscreen on primary monitor");
+	XFDASHBOARD_DEBUG(inWindowTracker, WINDOWS, "No support for multiple monitor: Setting fullscreen on primary monitor");
 
 	/* Get screen */
 	screen=gdk_screen_get_default();
@@ -223,9 +226,10 @@ static void _xfdashboard_window_tracker_window_on_screen_size_changed(Xfdashboar
 								WNCK_WINDOW_CHANGE_X | WNCK_WINDOW_CHANGE_Y | WNCK_WINDOW_CHANGE_WIDTH | WNCK_WINDOW_CHANGE_HEIGHT,
 								geometry.x, geometry.y, geometry.width, geometry.height);
 
-	g_debug("Moving stage window to %d,%d and resize to %dx%d",
-				geometry.x, geometry.y,
-				geometry.width, geometry.height);
+	XFDASHBOARD_DEBUG(inWindowTracker, WINDOWS,
+						"Moving stage window to %d,%d and resize to %dx%d",
+						geometry.x, geometry.y,
+						geometry.width, geometry.height);
 #endif
 }
 
@@ -242,7 +246,9 @@ static void _xfdashboard_window_tracker_window_on_stage_state_changed(WnckWindow
 		!(inNewValue & WNCK_WINDOW_STATE_SKIP_TASKLIST))
 	{
 		wnck_window_set_skip_tasklist(WNCK_WINDOW(inWindow), TRUE);
-		g_debug("State 'skip-tasklist' for stage window %p needs reset", inWindow);
+		XFDASHBOARD_DEBUG(inWindow, WINDOWS,
+							"State 'skip-tasklist' for stage window %p needs reset",
+							inWindow);
 	}
 
 	/* Set 'skip-pager' if changed */
@@ -250,7 +256,9 @@ static void _xfdashboard_window_tracker_window_on_stage_state_changed(WnckWindow
 		!(inNewValue & WNCK_WINDOW_STATE_SKIP_PAGER))
 	{
 		wnck_window_set_skip_pager(WNCK_WINDOW(inWindow), TRUE);
-		g_debug("State 'skip-pager' for stage window %p needs reset", inWindow);
+		XFDASHBOARD_DEBUG(inWindow, WINDOWS,
+							"State 'skip-pager' for stage window %p needs reset",
+							inWindow);
 	}
 
 	/* Set 'make-above' if changed */
@@ -258,7 +266,9 @@ static void _xfdashboard_window_tracker_window_on_stage_state_changed(WnckWindow
 		!(inNewValue & WNCK_WINDOW_STATE_ABOVE))
 	{
 		wnck_window_make_above(WNCK_WINDOW(inWindow));
-		g_debug("State 'make-above' for stage window %p needs reset", inWindow);
+		XFDASHBOARD_DEBUG(inWindow, WINDOWS,
+							"State 'make-above' for stage window %p needs reset",
+							inWindow);
 	}
 }
 
@@ -288,10 +298,11 @@ static void _xfdashboard_window_tracker_window_on_stage_active_window_changed(Wn
 	if(reselect)
 	{
 		wnck_window_activate_transient(stageWindow, xfdashboard_window_tracker_get_time());
-		g_debug("Active window changed from %p (%s) to %p (%s) but stage window %p is visible and should be active one",
-					inPreviousWindow, inPreviousWindow ? wnck_window_get_name(inPreviousWindow) : "<nil>",
-					activeWindow, activeWindow ? wnck_window_get_name(activeWindow) : "<nil>",
-					stageWindow);
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"Active window changed from %p (%s) to %p (%s) but stage window %p is visible and should be active one",
+							inPreviousWindow, inPreviousWindow ? wnck_window_get_name(inPreviousWindow) : "<nil>",
+							activeWindow, activeWindow ? wnck_window_get_name(activeWindow) : "<nil>",
+							stageWindow);
 	}
 }
 
@@ -789,7 +800,9 @@ void xfdashboard_window_tracker_window_make_stage_window(XfdashboardWindowTracke
 	if(!handlerID)
 	{
 		g_signal_connect(inWindow, "state-changed", G_CALLBACK(_xfdashboard_window_tracker_window_on_stage_state_changed), NULL);
-		g_debug("Connecting signal to 'state-changed' at window %p", inWindow);
+		XFDASHBOARD_DEBUG(inWindow, WINDOWS,
+							"Connecting signal to 'state-changed' at window %p",
+							inWindow);
 	}
 
 	signalID=g_signal_lookup("active-window-changed", WNCK_TYPE_SCREEN);
@@ -803,7 +816,10 @@ void xfdashboard_window_tracker_window_make_stage_window(XfdashboardWindowTracke
 	if(!handlerID)
 	{
 		g_signal_connect(screen, "active-window-changed", G_CALLBACK(_xfdashboard_window_tracker_window_on_stage_active_window_changed), inWindow);
-		g_debug("Connecting signal to 'active-window-changed' at screen %p of window %p", screen, inWindow);
+		XFDASHBOARD_DEBUG(screen, WINDOWS,
+							"Connecting signal to 'active-window-changed' at screen %p of window %p",
+							screen,
+							inWindow);
 	}
 
 	windowTracker=xfdashboard_window_tracker_get_default();
@@ -818,7 +834,9 @@ void xfdashboard_window_tracker_window_make_stage_window(XfdashboardWindowTracke
 	if(!handlerID)
 	{
 		g_signal_connect(windowTracker, "screen-size-changed", G_CALLBACK(_xfdashboard_window_tracker_window_on_screen_size_changed), inWindow);
-		g_debug("Connecting signal to 'screen-size-changed' at window %p", inWindow);
+		XFDASHBOARD_DEBUG(windowTracker, WINDOWS,
+							"Connecting signal to 'screen-size-changed' at window %p",
+							inWindow);
 	}
 	_xfdashboard_window_tracker_window_on_screen_size_changed(windowTracker,
 																xfdashboard_window_tracker_get_screen_width(windowTracker),
@@ -852,7 +870,10 @@ void xfdashboard_window_tracker_window_unmake_stage_window(XfdashboardWindowTrac
 	if(handlerID)
 	{
 		g_signal_handler_disconnect(inWindow, handlerID);
-		g_debug("Disconnecting handler %lu for signal 'state-changed' at window %p", handlerID, inWindow);
+		XFDASHBOARD_DEBUG(inWindow, WINDOWS,
+							"Disconnecting handler %lu for signal 'state-changed' at window %p",
+							handlerID,
+							inWindow);
 	}
 
 	signalID=g_signal_lookup("active-window-changed", WNCK_TYPE_SCREEN);
@@ -866,7 +887,11 @@ void xfdashboard_window_tracker_window_unmake_stage_window(XfdashboardWindowTrac
 	if(handlerID)
 	{
 		g_signal_handler_disconnect(screen, handlerID);
-		g_debug("Disconnecting handler %lu for signal 'active-window-changed' at screen %p of window %p", handlerID, screen, inWindow);
+		XFDASHBOARD_DEBUG(screen, WINDOWS,
+							"Disconnecting handler %lu for signal 'active-window-changed' at screen %p of window %p",
+							handlerID,
+							screen,
+							inWindow);
 	}
 
 	windowTracker=xfdashboard_window_tracker_get_default();
@@ -881,7 +906,10 @@ void xfdashboard_window_tracker_window_unmake_stage_window(XfdashboardWindowTrac
 	if(handlerID)
 	{
 		g_signal_handler_disconnect(windowTracker, handlerID);
-		g_debug("Disconnecting handler %lu for signal 'screen-size-changed' at window %p", handlerID, inWindow);
+		XFDASHBOARD_DEBUG(windowTracker, WINDOWS,
+							"Disconnecting handler %lu for signal 'screen-size-changed' at window %p",
+							handlerID,
+							inWindow);
 	}
 	g_object_unref(windowTracker);
 }
diff --git a/libxfdashboard/window-tracker.c b/libxfdashboard/window-tracker.c
index fae4647..180dcbb 100644
--- a/libxfdashboard/window-tracker.c
+++ b/libxfdashboard/window-tracker.c
@@ -47,6 +47,7 @@
 #include <libxfdashboard/marshal.h>
 #include <libxfdashboard/application.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -167,12 +168,16 @@ static void _xfdashboard_window_tracker_on_window_geometry_changed(XfdashboardWi
 
 	if(G_UNLIKELY(lastX==x && lastY==y && lastWidth==width && lastHeight==height))
 	{
-		g_debug("Window '%s' has not moved or resized", wnck_window_get_name(window));
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"Window '%s' has not moved or resized",
+							wnck_window_get_name(window));
 		return;
 	}
 
 	/* Emit signal */
-	g_debug("Window '%s' changed position and/or size", wnck_window_get_name(window));
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Window '%s' changed position and/or size",
+						wnck_window_get_name(window));
 	g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_WINDOW_GEOMETRY_CHANGED], 0, window);
 
 	/* Get monitor at old position of window and the monitor at current position.
@@ -211,10 +216,11 @@ static void _xfdashboard_window_tracker_on_window_geometry_changed(XfdashboardWi
 	if(currentMonitor!=lastMonitor)
 	{
 		/* Emit signal */
-		g_debug("Window '%s' moved from monitor %d to %d",
-					wnck_window_get_name(window),
-					xfdashboard_window_tracker_monitor_get_number(lastMonitor),
-					xfdashboard_window_tracker_monitor_get_number(currentMonitor));
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"Window '%s' moved from monitor %d to %d",
+							wnck_window_get_name(window),
+							xfdashboard_window_tracker_monitor_get_number(lastMonitor),
+							xfdashboard_window_tracker_monitor_get_number(currentMonitor));
 		g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_WINDOW_MONITOR_CHANGED], 0, window, lastMonitor, currentMonitor);
 	}
 
@@ -239,7 +245,11 @@ static void _xfdashboard_window_tracker_on_window_actions_changed(XfdashboardWin
 	window=WNCK_WINDOW(inUserData);
 
 	/* Emit signal */
-	g_debug("Window '%s' changed actions to %u with mask %u", wnck_window_get_name(window), inNewValue, inChangedMask);
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Window '%s' changed actions to %u with mask %u",
+						wnck_window_get_name(window),
+						inNewValue,
+						inChangedMask);
 	g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_WINDOW_ACTIONS_CHANGED], 0, window);
 }
 
@@ -257,7 +267,11 @@ static void _xfdashboard_window_tracker_on_window_state_changed(XfdashboardWindo
 	window=WNCK_WINDOW(inUserData);
 
 	/* Emit signal */
-	g_debug("Window '%s' changed state to %u with mask %u", wnck_window_get_name(window), inNewValue, inChangedMask);
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Window '%s' changed state to %u with mask %u",
+						wnck_window_get_name(window),
+						inNewValue,
+						inChangedMask);
 	g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_WINDOW_STATE_CHANGED], 0, window);
 }
 
@@ -272,7 +286,9 @@ static void _xfdashboard_window_tracker_on_window_icon_changed(XfdashboardWindow
 	window=WNCK_WINDOW(inUserData);
 
 	/* Emit signal */
-	g_debug("Window '%s' changed its icon", wnck_window_get_name(window));
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Window '%s' changed its icon",
+						wnck_window_get_name(window));
 	g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_WINDOW_ICON_CHANGED], 0, window);
 }
 
@@ -287,7 +303,9 @@ static void _xfdashboard_window_tracker_on_window_name_changed(XfdashboardWindow
 	window=WNCK_WINDOW(inUserData);
 
 	/* Emit "signal */
-	g_debug("Window changed its name to '%s'", wnck_window_get_name(window));
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Window changed its name to '%s'",
+						wnck_window_get_name(window));
 	g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_WINDOW_NAME_CHANGED], 0, window);
 }
 
@@ -306,10 +324,11 @@ static void _xfdashboard_window_tracker_on_window_workspace_changed(XfdashboardW
 	workspace=wnck_window_get_workspace(window);
 
 	/* Emit signal */
-	g_debug("Window '%s' moved to workspace %d (%s)",
-				wnck_window_get_name(window),
-				workspace ? wnck_workspace_get_number(workspace) : -1,
-				workspace ? wnck_workspace_get_name(workspace) : "<nil>");
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Window '%s' moved to workspace %d (%s)",
+						wnck_window_get_name(window),
+						workspace ? wnck_workspace_get_number(workspace) : -1,
+						workspace ? wnck_workspace_get_name(workspace) : "<nil>");
 	g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_WINDOW_WORKSPACE_CHANGED], 0, window, workspace);
 }
 
@@ -334,9 +353,10 @@ static void _xfdashboard_window_tracker_on_active_window_changed(XfdashboardWind
 	priv->activeWindow=wnck_screen_get_active_window(screen);
 
 	/* Emit signal */
-	g_debug("Active window changed from '%s' to '%s'",
-				oldActiveWindow ? wnck_window_get_name(oldActiveWindow) : "<nil>",
-				priv->activeWindow ? wnck_window_get_name(priv->activeWindow) : "<nil>");
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Active window changed from '%s' to '%s'",
+						oldActiveWindow ? wnck_window_get_name(oldActiveWindow) : "<nil>",
+						priv->activeWindow ? wnck_window_get_name(priv->activeWindow) : "<nil>");
 	g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_ACTIVE_WINDOW_CHANGED], 0, oldActiveWindow, priv->activeWindow);
 }
 
@@ -362,7 +382,9 @@ static void _xfdashboard_window_tracker_on_window_closed(XfdashboardWindowTracke
 	g_signal_handlers_disconnect_by_data(inWindow, self);
 
 	/* Emit signals */
-	g_debug("Window '%s' closed", wnck_window_get_name(inWindow));
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Window '%s' closed",
+						wnck_window_get_name(inWindow));
 	g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_WINDOW_CLOSED], 0, inWindow);
 }
 
@@ -402,7 +424,9 @@ static void _xfdashboard_window_tracker_on_window_opened(XfdashboardWindowTracke
 	}
 
 	/* Emit signal */
-	g_debug("Window '%s' created", wnck_window_get_name(inWindow));
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Window '%s' created",
+						wnck_window_get_name(inWindow));
 	g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_WINDOW_OPENED], 0, inWindow);
 }
 
@@ -413,7 +437,7 @@ static void _xfdashboard_window_tracker_on_window_stacking_changed(XfdashboardWi
 	g_return_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER(self));
 
 	/* Emit signal */
-	g_debug("Window stacking has changed");
+	XFDASHBOARD_DEBUG(self, WINDOWS, "Window stacking has changed");
 	g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_WINDOW_STACKING_CHANGED], 0);
 }
 
@@ -429,7 +453,10 @@ static void _xfdashboard_window_tracker_on_workspace_name_changed(XfdashboardWin
 	workspace=WNCK_WORKSPACE(inUserData);
 
 	/* Emit signal */
-	g_debug("Workspace #%d changed name to '%s'", wnck_workspace_get_number(workspace), wnck_workspace_get_name(workspace));
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Workspace #%d changed name to '%s'",
+						wnck_workspace_get_number(workspace),
+						wnck_workspace_get_name(workspace));
 	g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_WORKSPACE_NAME_CHANGED], 0, workspace);
 
 }
@@ -455,11 +482,12 @@ static void _xfdashboard_window_tracker_on_active_workspace_changed(XfdashboardW
 	priv->activeWorkspace=wnck_screen_get_active_workspace(screen);
 
 	/* Emit signal */
-	g_debug("Active workspace changed from #%d (%s) to #%d (%s)",
-				oldActiveWorkspace ? wnck_workspace_get_number(oldActiveWorkspace) : -1,
-				oldActiveWorkspace ? wnck_workspace_get_name(oldActiveWorkspace) : "<nil>",
-				priv->activeWorkspace ? wnck_workspace_get_number(priv->activeWorkspace) : -1,
-				priv->activeWorkspace ? wnck_workspace_get_name(priv->activeWorkspace) : "<nil>");
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Active workspace changed from #%d (%s) to #%d (%s)",
+						oldActiveWorkspace ? wnck_workspace_get_number(oldActiveWorkspace) : -1,
+						oldActiveWorkspace ? wnck_workspace_get_name(oldActiveWorkspace) : "<nil>",
+						priv->activeWorkspace ? wnck_workspace_get_number(priv->activeWorkspace) : -1,
+						priv->activeWorkspace ? wnck_workspace_get_name(priv->activeWorkspace) : "<nil>");
 	g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_ACTIVE_WORKSPACE_CHANGED], 0, oldActiveWorkspace, priv->activeWorkspace);
 }
 
@@ -485,7 +513,10 @@ static void _xfdashboard_window_tracker_on_workspace_destroyed(XfdashboardWindow
 	g_signal_handlers_disconnect_by_data(inWorkspace, self);
 
 	/* Emit signal */
-	g_debug("Workspace #%d (%s) destroyed", wnck_workspace_get_number(inWorkspace), wnck_workspace_get_name(inWorkspace));
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Workspace #%d (%s) destroyed",
+						wnck_workspace_get_number(inWorkspace),
+						wnck_workspace_get_name(inWorkspace));
 	g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_WORKSPACE_REMOVED], 0, inWorkspace);
 }
 
@@ -502,7 +533,10 @@ static void _xfdashboard_window_tracker_on_workspace_created(XfdashboardWindowTr
 	g_signal_connect_swapped(inWorkspace, "name-changed", G_CALLBACK(_xfdashboard_window_tracker_on_workspace_name_changed), self);
 
 	/* Emit signal */
-	g_debug("New workspace #%d (%s) created", wnck_workspace_get_number(inWorkspace), wnck_workspace_get_name(inWorkspace));
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"New workspace #%d (%s) created",
+						wnck_workspace_get_number(inWorkspace),
+						wnck_workspace_get_name(inWorkspace));
 	g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_WORKSPACE_ADDED], 0, inWorkspace);
 }
 
@@ -539,9 +573,10 @@ static void _xfdashboard_window_tracker_on_primary_monitor_changed(XfdashboardWi
 		/* Notify about property change */
 		g_object_notify_by_pspec(G_OBJECT(self), XfdashboardWindowTrackerProperties[PROP_PRIMARY_MONITOR]);
 
-		g_debug("Primary monitor changed from %d to %d",
-					oldMonitor ? xfdashboard_window_tracker_monitor_get_number(oldMonitor) : -1,
-					xfdashboard_window_tracker_monitor_get_number(monitor));
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"Primary monitor changed from %d to %d",
+							oldMonitor ? xfdashboard_window_tracker_monitor_get_number(oldMonitor) : -1,
+							xfdashboard_window_tracker_monitor_get_number(monitor));
 	}
 }
 
@@ -589,7 +624,9 @@ static XfdashboardWindowTrackerMonitor* _xfdashboard_window_tracker_monitor_new(
 
 	/* Emit signal */
 	g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_MONITOR_ADDED], 0, monitor);
-	g_debug("Monitor %d added", inMonitorIndex);
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Monitor %d added",
+						inMonitorIndex);
 
 	/* If we newly added monitor is the primary one then emit signal. We could not
 	 * have done it yet because the signals were connect to new monitor object
@@ -629,7 +666,9 @@ static void _xfdashboard_window_tracker_monitor_free(XfdashboardWindowTracker *s
 
 	/* Emit signal */
 	g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_MONITOR_REMOVED], 0, inMonitor);
-	g_debug("Monitor %d removed", xfdashboard_window_tracker_monitor_get_number(inMonitor));
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Monitor %d removed",
+						xfdashboard_window_tracker_monitor_get_number(inMonitor));
 
 	/* Remove monitor object from list */
 	priv->monitors=g_list_delete_link(priv->monitors, iter);
@@ -666,7 +705,10 @@ static void _xfdashboard_window_tracker_on_monitors_changed(XfdashboardWindowTra
 	newMonitorCount=gdk_screen_get_n_monitors(screen);
 	if(newMonitorCount!=currentMonitorCount)
 	{
-		g_debug("Number of monitors changed from %d to %d", currentMonitorCount, newMonitorCount);
+		XFDASHBOARD_DEBUG(self, WINDOWS,
+							"Number of monitors changed from %d to %d",
+							currentMonitorCount,
+							newMonitorCount);
 	}
 
 	/* There is no need to check if size of any monitor has changed because
@@ -723,7 +765,10 @@ static void _xfdashboard_window_tracker_on_screen_size_changed(XfdashboardWindow
 	h=gdk_screen_get_height(screen);
 
 	/* Emit signal to tell that screen size has changed */
-	g_debug("Screen size changed to %dx%d", w, h);
+	XFDASHBOARD_DEBUG(self, WINDOWS,
+						"Screen size changed to %dx%d",
+						w,
+						h);
 	g_signal_emit(self, XfdashboardWindowTrackerSignals[SIGNAL_SCREEN_SIZE_CHANGED], 0, w, h);
 }
 
@@ -1176,7 +1221,7 @@ void xfdashboard_window_tracker_init(XfdashboardWindowTracker *self)
 
 	priv=self->priv=XFDASHBOARD_WINDOW_TRACKER_GET_PRIVATE(self);
 
-	g_debug("Initializing window tracker");
+	XFDASHBOARD_DEBUG(self, WINDOWS, "Initializing window tracker");
 
 	/* Set default values */
 	priv->screen=wnck_screen_get_default();
@@ -1315,21 +1360,23 @@ guint32 xfdashboard_window_tracker_get_time(void)
 	if(timestamp>0) return(timestamp);
 
 	/* Next we try to retrieve timestamp of last X11 event in clutter */
-	g_debug("No timestamp for windows - trying timestamp of last X11 event in Clutter");
+	XFDASHBOARD_DEBUG(NULL, WINDOWS, "No timestamp for windows - trying timestamp of last X11 event in Clutter");
 	timestamp=(guint32)clutter_x11_get_current_event_time();
 	if(timestamp!=0)
 	{
-		g_debug("Got timestamp %u of last X11 event in Clutter", timestamp);
+		XFDASHBOARD_DEBUG(NULL, WINDOWS,
+							"Got timestamp %u of last X11 event in Clutter",
+							timestamp);
 		return(timestamp);
 	}
 
 	/* Last resort is to get X11 server time via stage windows */
-	g_debug("No timestamp for windows - trying last resort via stage windows");
+	XFDASHBOARD_DEBUG(NULL, WINDOWS, "No timestamp for windows - trying last resort via stage windows");
 
 	display=gdk_display_get_default();
 	if(!display)
 	{
-		g_debug("No default display found in GDK to get timestamp for windows");
+		XFDASHBOARD_DEBUG(NULL, WINDOWS, "No default display found in GDK to get timestamp for windows");
 		return(0);
 	}
 
@@ -1346,7 +1393,9 @@ guint32 xfdashboard_window_tracker_get_time(void)
 			window=gdk_x11_window_lookup_for_display(display, clutter_x11_get_stage_window(stage));
 			if(!window)
 			{
-				g_debug("No GDK window found for stage %p to get timestamp for windows", stage);
+				XFDASHBOARD_DEBUG(NULL, WINDOWS,
+									"No GDK window found for stage %p to get timestamp for windows",
+									stage);
 				continue;
 			}
 
@@ -1356,8 +1405,10 @@ guint32 xfdashboard_window_tracker_get_time(void)
 			eventMask=gdk_window_get_events(window);
 			if(!(eventMask & GDK_PROPERTY_CHANGE_MASK))
 			{
-				g_debug("GDK window %p for stage %p does not support GDK_PROPERTY_CHANGE_MASK to get timestamp for windows",
-							window, stage);
+				XFDASHBOARD_DEBUG(NULL, WINDOWS,
+									"GDK window %p for stage %p does not support GDK_PROPERTY_CHANGE_MASK to get timestamp for windows",
+									window,
+									stage);
 				continue;
 			}
 
@@ -1367,7 +1418,10 @@ guint32 xfdashboard_window_tracker_get_time(void)
 	g_slist_free(stages);
 
 	/* Return timestamp of last resort */
-	g_debug("Last resort timestamp for windows %s (%u)", timestamp ? "found" : "not found", timestamp);
+	XFDASHBOARD_DEBUG(NULL, WINDOWS,
+						"Last resort timestamp for windows %s (%u)",
+						timestamp ? "found" : "not found",
+						timestamp);
 	return(timestamp);
 }
 
@@ -1558,7 +1612,7 @@ XfdashboardWindowTrackerWindow* xfdashboard_window_tracker_get_root_window(Xfdas
 		backgroundWindow=wnck_window_get(backgroundWindowID);
 		if(backgroundWindow)
 		{
-			g_debug("Found desktop window by known background pixmap ID");
+			XFDASHBOARD_DEBUG(self, WINDOWS, "Found desktop window by known background pixmap ID");
 			return(XFDASHBOARD_WINDOW_TRACKER_WINDOW(backgroundWindow));
 		}
 	}
@@ -1577,7 +1631,7 @@ XfdashboardWindowTrackerWindow* xfdashboard_window_tracker_get_root_window(Xfdas
 		windowType=wnck_window_get_window_type(window);
 		if(windowType==WNCK_WINDOW_DESKTOP)
 		{
-			g_debug("Desktop window ID found while iterating through window list");
+			XFDASHBOARD_DEBUG(self, WINDOWS, "Desktop window ID found while iterating through window list");
 				return(XFDASHBOARD_WINDOW_TRACKER_WINDOW(window));
 		}
 	}
@@ -1585,6 +1639,6 @@ XfdashboardWindowTrackerWindow* xfdashboard_window_tracker_get_root_window(Xfdas
 	/* If we get here either desktop window does not exist or is not known
 	 * in window list. So return NULL here.
 	 */
-	g_debug("Desktop window could not be found");
+	XFDASHBOARD_DEBUG(self, WINDOWS, "Desktop window could not be found");
 	return(NULL);
 }
diff --git a/libxfdashboard/windows-view.c b/libxfdashboard/windows-view.c
index 357d5b3..72bb637 100644
--- a/libxfdashboard/windows-view.c
+++ b/libxfdashboard/windows-view.c
@@ -45,6 +45,7 @@
 #include <libxfdashboard/enums.h>
 #include <libxfdashboard/stage-interface.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -403,16 +404,17 @@ static void _xfdashboard_windows_view_move_live_to_view(XfdashboardWindowsView *
 	sourceMonitor=xfdashboard_window_tracker_window_get_monitor(window);
 	targetMonitor=priv->currentMonitor;
 
-	g_debug("Moving window '%s' from %s-monitor %d to %s-monitor %d and from workspace '%s' (%d) to '%s' (%d)",
-				xfdashboard_window_tracker_window_get_title(window),
-				xfdashboard_window_tracker_monitor_is_primary(sourceMonitor) ? "primary" : "secondary",
-				xfdashboard_window_tracker_monitor_get_number(sourceMonitor),
-				xfdashboard_window_tracker_monitor_is_primary(targetMonitor) ? "primary" : "secondary",
-				xfdashboard_window_tracker_monitor_get_number(targetMonitor),
-				xfdashboard_window_tracker_workspace_get_name(sourceWorkspace),
-				xfdashboard_window_tracker_workspace_get_number(sourceWorkspace),
-				xfdashboard_window_tracker_workspace_get_name(targetWorkspace),
-				xfdashboard_window_tracker_workspace_get_number(targetWorkspace));
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Moving window '%s' from %s-monitor %d to %s-monitor %d and from workspace '%s' (%d) to '%s' (%d)",
+						xfdashboard_window_tracker_window_get_title(window),
+						xfdashboard_window_tracker_monitor_is_primary(sourceMonitor) ? "primary" : "secondary",
+						xfdashboard_window_tracker_monitor_get_number(sourceMonitor),
+						xfdashboard_window_tracker_monitor_is_primary(targetMonitor) ? "primary" : "secondary",
+						xfdashboard_window_tracker_monitor_get_number(targetMonitor),
+						xfdashboard_window_tracker_workspace_get_name(sourceWorkspace),
+						xfdashboard_window_tracker_workspace_get_number(sourceWorkspace),
+						xfdashboard_window_tracker_workspace_get_name(targetWorkspace),
+						xfdashboard_window_tracker_workspace_get_number(targetWorkspace));
 
 	/* Get position and size of window to move */
 	xfdashboard_window_tracker_window_get_position_size(window,
@@ -443,23 +445,25 @@ static void _xfdashboard_windows_view_move_live_to_view(XfdashboardWindowsView *
 	if(!xfdashboard_window_tracker_workspace_is_equal(sourceWorkspace, targetWorkspace))
 	{
 		xfdashboard_window_tracker_window_move_to_workspace(window, targetWorkspace);
-		g_debug("Moved window '%s' from workspace '%s' (%d) to '%s' (%d)",
-					xfdashboard_window_tracker_window_get_title(window),
-					xfdashboard_window_tracker_workspace_get_name(sourceWorkspace),
-					xfdashboard_window_tracker_workspace_get_number(sourceWorkspace),
-					xfdashboard_window_tracker_workspace_get_name(targetWorkspace),
-					xfdashboard_window_tracker_workspace_get_number(targetWorkspace));
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"Moved window '%s' from workspace '%s' (%d) to '%s' (%d)",
+							xfdashboard_window_tracker_window_get_title(window),
+							xfdashboard_window_tracker_workspace_get_name(sourceWorkspace),
+							xfdashboard_window_tracker_workspace_get_number(sourceWorkspace),
+							xfdashboard_window_tracker_workspace_get_name(targetWorkspace),
+							xfdashboard_window_tracker_workspace_get_number(targetWorkspace));
 	}
 
 	/* Move window to new position */
 	xfdashboard_window_tracker_window_move(window, newWindowX, newWindowY);
-	g_debug("Moved window '%s' from [%d,%d] at monitor [%d,%d x %d,%d] to [%d,%d] at monitor [%d,%d x %d,%d] (relative x=%.2f, y=%.2f)",
-				xfdashboard_window_tracker_window_get_title(window),
-				oldWindowX, oldWindowY,
-				oldMonitorX, oldMonitorY, oldMonitorWidth, oldMonitorHeight,
-				newWindowX, newWindowY,
-				newMonitorX, newMonitorY, newMonitorWidth, newMonitorHeight,
-				relativeX, relativeY);
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Moved window '%s' from [%d,%d] at monitor [%d,%d x %d,%d] to [%d,%d] at monitor [%d,%d x %d,%d] (relative x=%.2f, y=%.2f)",
+						xfdashboard_window_tracker_window_get_title(window),
+						oldWindowX, oldWindowY,
+						oldMonitorX, oldMonitorY, oldMonitorWidth, oldMonitorHeight,
+						newWindowX, newWindowY,
+						newMonitorX, newMonitorY, newMonitorWidth, newMonitorHeight,
+						relativeX, relativeY);
 }
 
 /* Drag of an actor to this view as drop target begins */
@@ -952,7 +956,7 @@ static XfdashboardLiveWindow* _xfdashboard_windows_view_create_actor(Xfdashboard
 	/* Check if window opened is a stage window */
 	if(xfdashboard_window_tracker_window_is_stage(inWindow))
 	{
-		g_debug("Will not create live-window actor for stage window.");
+		XFDASHBOARD_DEBUG(self, ACTOR, "Will not create live-window actor for stage window.");
 		return(NULL);
 	}
 
@@ -1053,9 +1057,10 @@ static gboolean _xfdashboard_windows_view_on_scroll_event(ClutterActor *inActor,
 
 		/* Unhandled directions */
 		default:
-			g_debug("Cannot handle scroll direction %d in %s",
-						clutter_event_get_scroll_direction(inEvent),
-						G_OBJECT_TYPE_NAME(self));
+			XFDASHBOARD_DEBUG(self, ACTOR,
+								"Cannot handle scroll direction %d in %s",
+								clutter_event_get_scroll_direction(inEvent),
+								G_OBJECT_TYPE_NAME(self));
 			return(CLUTTER_EVENT_PROPAGATE);
 	}
 
@@ -1161,7 +1166,7 @@ static gboolean _xfdashboard_windows_view_window_close(XfdashboardWindowsView *s
 	/* Check if a window is currenly selected */
 	if(!priv->selectedItem)
 	{
-		g_debug("No window to close is selected.");
+		XFDASHBOARD_DEBUG(self, ACTOR, "No window to close is selected.");
 		return(CLUTTER_EVENT_STOP);
 	}
 
@@ -1510,10 +1515,11 @@ static ClutterActor* _xfdashboard_windows_view_focusable_find_selection(Xfdashbo
 		newSelection=clutter_actor_get_first_child(CLUTTER_ACTOR(self));
 
 		valueName=xfdashboard_get_enum_value_name(XFDASHBOARD_TYPE_SELECTION_TARGET, inDirection);
-		g_debug("No selection at %s, so select first child %s for direction %s",
-				G_OBJECT_TYPE_NAME(self),
-				newSelection ? G_OBJECT_TYPE_NAME(newSelection) : "<nil>",
-				valueName);
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"No selection at %s, so select first child %s for direction %s",
+							G_OBJECT_TYPE_NAME(self),
+							newSelection ? G_OBJECT_TYPE_NAME(newSelection) : "<nil>",
+							valueName);
 		g_free(valueName);
 
 		return(newSelection);
@@ -1651,11 +1657,12 @@ static ClutterActor* _xfdashboard_windows_view_focusable_find_selection(Xfdashbo
 	if(newSelection) selection=newSelection;
 
 	/* Return new selection found */
-	g_debug("Selecting %s at %s for current selection %s in direction %u",
-			selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
-			G_OBJECT_TYPE_NAME(self),
-			inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
-			inDirection);
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Selecting %s at %s for current selection %s in direction %u",
+						selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
+						G_OBJECT_TYPE_NAME(self),
+						inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
+						inDirection);
 
 	return(selection);
 }
diff --git a/libxfdashboard/workspace-selector.c b/libxfdashboard/workspace-selector.c
index 785d172..e7faa95 100644
--- a/libxfdashboard/workspace-selector.c
+++ b/libxfdashboard/workspace-selector.c
@@ -43,6 +43,7 @@
 #include <libxfdashboard/focusable.h>
 #include <libxfdashboard/stage-interface.h>
 #include <libxfdashboard/compat.h>
+#include <libxfdashboard/debug.h>
 
 
 /* Define this class in GObject system */
@@ -512,9 +513,10 @@ static gboolean _xfdashboard_workspace_selector_on_scroll_event(ClutterActor *in
 
 		/* Unhandled directions */
 		default:
-			g_debug("Cannot handle scroll direction %d in %s",
-						clutter_event_get_scroll_direction(inEvent),
-						G_OBJECT_TYPE_NAME(self));
+			XFDASHBOARD_DEBUG(self, ACTOR,
+								"Cannot handle scroll direction %d in %s",
+								clutter_event_get_scroll_direction(inEvent),
+								G_OBJECT_TYPE_NAME(self));
 			return(CLUTTER_EVENT_PROPAGATE);
 	}
 
@@ -943,10 +945,11 @@ static ClutterActor* _xfdashboard_workspace_selector_focusable_find_selection(Xf
 	if(!inSelection)
 	{
 		valueName=xfdashboard_get_enum_value_name(XFDASHBOARD_TYPE_SELECTION_TARGET, inDirection);
-		g_debug("No selection at %s, so select first child %s for direction %s",
-				G_OBJECT_TYPE_NAME(self),
-				selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
-				valueName);
+		XFDASHBOARD_DEBUG(self, ACTOR,
+							"No selection at %s, so select first child %s for direction %s",
+							G_OBJECT_TYPE_NAME(self),
+							selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
+							valueName);
 		g_free(valueName);
 
 		return(CLUTTER_ACTOR(selection));
@@ -1042,11 +1045,12 @@ static ClutterActor* _xfdashboard_workspace_selector_focusable_find_selection(Xf
 	}
 
 	/* Return new selection found */
-	g_debug("Selecting %s at %s for current selection %s in direction %u",
-			selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
-			G_OBJECT_TYPE_NAME(self),
-			inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
-			inDirection);
+	XFDASHBOARD_DEBUG(self, ACTOR,
+						"Selecting %s at %s for current selection %s in direction %u",
+						selection ? G_OBJECT_TYPE_NAME(selection) : "<nil>",
+						G_OBJECT_TYPE_NAME(self),
+						inSelection ? G_OBJECT_TYPE_NAME(inSelection) : "<nil>",
+						inDirection);
 
 	return(CLUTTER_ACTOR(selection));
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list