+ fprintf(stderr, "DEBUG: ");
+ va_start(vl, a);
+ vfprintf(stderr, a, vl);
+ va_end(vl);
+ }
+}
+
+static gboolean enabled_types[OB_DEBUG_TYPE_NUM] = {FALSE};
+
+void ob_debug_enable(ObDebugType type, gboolean enable)
+{
+ g_assert(type < OB_DEBUG_TYPE_NUM);
+ enabled_types[type] = enable;
+}
+
+void ob_debug_type(ObDebugType type, const gchar *a, ...)
+{
+ va_list vl;
+
+ g_assert(type < OB_DEBUG_TYPE_NUM);
+
+ if (show && enabled_types[type]) {
+ switch (type) {
+ case OB_DEBUG_FOCUS:
+ fprintf(stderr, "FOCUS: ");
+ break;
+ case OB_DEBUG_APP_BUGS:
+ fprintf(stderr, "APPLICATION BUG: ");
+ break;
+ case OB_DEBUG_SM:
+ fprintf(stderr, "SESSION: ");
+ break;
+ default:
+ g_assert_not_reached();
+ }
+