Default disable all loggings. Fixed two macro nits.

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.


svn path=/trunk/; revision=6865
This commit is contained in:
Lin Ma 2008-04-21 02:40:40 +00:00 committed by Lin Ma
parent e4d486dc32
commit 6965703ad2
6 changed files with 44 additions and 17 deletions

View File

@ -1,3 +1,10 @@
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

View File

@ -43,11 +43,12 @@
#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);

View File

@ -35,11 +35,12 @@
#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);

View File

@ -33,17 +33,18 @@
#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 */
@ -85,12 +86,17 @@ is_ported (gpointer f)
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");
@ -116,9 +122,9 @@ printevent (const char *pname, int event, const char *tag)
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
@ -128,7 +134,7 @@ port_add_kevent (int e, gpointer f)
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.
@ -224,7 +230,8 @@ port_fetch_event_cb (void *arg)
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 */

View File

@ -29,10 +29,16 @@
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;

View File

@ -37,8 +37,13 @@ struct _dnode {
GTimeVal tv;
};
#ifdef GIO_COMPILATION
#define FN_W if (fn_debug_enabled) g_warning
static gboolean fn_debug_enabled = FALSE;
#else
#include "gam_error.h"
#define FN_W(...) GAM_DEBUG(DEBUG_INFO, __VA_ARGS__)
#endif
G_LOCK_EXTERN (fen_lock);
#define PROCESS_DELETING_INTERVAL 900 /* in second */