+
+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]) {
+ va_start(vl, a);
+ vfprintf(stderr, a, vl);
+ va_end(vl);
+ }
+}