+2008-04-21 Lin Ma <Lin.Ma@Sun.COM>
+
+ * fen/fen-data.c, fen/fen-helper.c, fen/fen-missing.c, fen/fen-node.c:
+ Default disable all loggings.
+ * fen/fen-kernel.c: (printevent), (port_add_kevent),
+ (port_fetch_event_cb): Fixed two macro nits.
+
2008-04-16 Matthias Clasen <mclasen@redhat.com>
* xdgmime/xdgmime.c: Rework the timestamp checking code
#define INIT_CHANGES_NUM 2
#define BASE_NUM 2
-#define FD_W if (fd_debug_enabled) g_warning
#ifdef GIO_COMPILATION
+#define FD_W if (fd_debug_enabled) g_warning
static gboolean fd_debug_enabled = FALSE;
#else
-static gboolean fd_debug_enabled = TRUE;
+#include "gam_error.h"
+#define FD_W(...) GAM_DEBUG(DEBUG_INFO, __VA_ARGS__)
#endif
G_LOCK_EXTERN (fen_lock);
#include "gam_protocol.h"
#endif
-#define FH_W if (fh_debug_enabled) g_warning
#ifdef GIO_COMPILATION
+#define FH_W if (fh_debug_enabled) g_warning
static gboolean fh_debug_enabled = FALSE;
#else
-static gboolean fh_debug_enabled = TRUE;
+#include "gam_error.h"
+#define FH_W(...) GAM_DEBUG(DEBUG_INFO, __VA_ARGS__)
#endif
G_LOCK_EXTERN (fen_lock);
#include "fen-kernel.h"
#include "fen-dump.h"
-#define FK_W if (fk_debug_enabled) g_warning
#ifdef GIO_COMPILATION
+#define FK_W if (fk_debug_enabled) g_warning
static gboolean fk_debug_enabled = FALSE;
#else
-static gboolean fk_debug_enabled = TRUE;
+#include "gam_error.h"
+#define FK_W(...) GAM_DEBUG(DEBUG_INFO, __VA_ARGS__)
#endif
G_GNUC_INTERNAL G_LOCK_DEFINE (fen_lock);
#define PE_ALLOC 64
-#define F_PORT(pp) (((_f *)(fo))->port->port)
-#define F_NAME(pp) (((_f *)(fo))->fobj->fo_name)
+#define F_PORT(pfo) (((_f *)(pfo))->port->port)
+#define F_NAME(pfo) (((_f *)(pfo))->fobj->fo_name)
#define FEN_ALL_EVENTS (FILE_MODIFIED | FILE_ATTRIB | FILE_NOFOLLOW)
#define FEN_IGNORE_EVENTS (FILE_ACCESS)
#define PROCESS_PORT_EVENTS_TIME 400 /* in milliseconds */
return FALSE;
}
-static void
+static gchar*
printevent (const char *pname, int event, const char *tag)
{
- GString* str;
+ static gchar *event_string = NULL;
+ GString *str;
+
+ if (event_string) {
+ g_free(event_string);
+ }
+
str = g_string_new ("");
-
g_string_printf (str, "[%s] [%-20s]", tag, pname);
if (event & FILE_ACCESS) {
str = g_string_append (str, " ACCESS");
if (event & MOUNTEDOVER) {
str = g_string_append (str, " MOUNTEDOVER");
}
-
- FK_W ("%s\n", str->str);
- g_string_free (str, TRUE);
+ event_string = str->str;
+ g_string_free (str, FALSE);
+ return event_string;
}
static void
GTimeVal t;
gboolean has_twin = FALSE;
- /* printevent (F_NAME(f), e, "org"); */
+ FK_W("%s\n", printevent(F_NAME(f), e, "org"));
/*
* Child FILE_DELETE | FILE_RENAME_FROM will trigger parent FILE_MODIFIED.
* FILE_MODIFIED will trigger FILE_ATTRIB.
delete the pnode */
fo->is_active = FALSE;
if (fo->user_data) {
- printevent (F_NAME(fo), pe[i].portev_events, "RAW");
+ FK_W("%s\n",
+ printevent(F_NAME(fo), pe[i].portev_events, "RAW"));
port_add_kevent (pe[i].portev_events, fo->user_data);
} else {
/* fnode is deleted */
G_LOCK_EXTERN (fen_lock);
#define SCAN_MISSING_INTERVAL 4000 /* in milliseconds */
+
+#ifdef GIO_COMPILATION
#define FM_W if (fm_debug_enabled) g_warning
+gboolean fm_debug_enabled = FALSE;
+#else
+#include "gam_error.h"
+#define FM_W(...) GAM_DEBUG(DEBUG_INFO, __VA_ARGS__)
+#endif
/* global data structure for scan missing files */
-gboolean fm_debug_enabled = TRUE;
static GList *missing_list = NULL;
static guint scan_missing_source_id = 0;