diff src/filecache.c @ 1498:5f49f305a6b6

improved debug messages
author nadvornik
date Tue, 31 Mar 2009 20:05:16 +0000
parents cf4029d10d38
children 956aab097ea7
line wrap: on
line diff
--- a/src/filecache.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/filecache.c	Tue Mar 31 20:05:16 2009 +0000
@@ -60,10 +60,10 @@
 		if (fce->fd == fd)
 			{
 			/* entry exists */
-			DEBUG_1("cache hit: fc=%p %s", fc, fd->path);
+			DEBUG_2("cache hit: fc=%p %s", fc, fd->path);
 			if (work == fc->list) return TRUE; /* already at the beginning */
 			/* move it to the beginning */
-			DEBUG_1("cache move to front: fc=%p %s", fc, fd->path);
+			DEBUG_2("cache move to front: fc=%p %s", fc, fd->path);
 			fc->list = g_list_remove_link(fc->list, work);
 			fc->list = g_list_concat(work, fc->list);
 			
@@ -75,7 +75,7 @@
 			}
 		work = work->next;
 		}
-	DEBUG_1("cache miss: fc=%p %s", fc, fd->path);
+	DEBUG_2("cache miss: fc=%p %s", fc, fd->path);
 	return FALSE;
 }
 
@@ -95,7 +95,7 @@
 		fc->list = g_list_delete_link(fc->list, work);
 		work = prev;
 		
-		DEBUG_1("file changed - cache remove: fc=%p %s", fc, last_fe->fd->path);
+		DEBUG_2("file changed - cache remove: fc=%p %s", fc, last_fe->fd->path);
 		fc->size -= last_fe->size;
 		fc->release(last_fe->fd);
 		file_data_unref(last_fe->fd);
@@ -109,7 +109,7 @@
 
 	if (file_cache_get(fc, fd)) return;
 	
-	DEBUG_1("cache add: fc=%p %s", fc, fd->path);
+	DEBUG_2("cache add: fc=%p %s", fc, fd->path);
 	fe = g_new(FileCacheEntry, 1);
 	fe->fd = file_data_ref(fd);
 	fe->size = size;
@@ -183,6 +183,7 @@
 
 	if (type & (NOTIFY_REREAD | NOTIFY_CHANGE)) /* invalidate the entry on each file change */
 		{
+		DEBUG_1("Notify cache: %s %04x", fd->path, type);
 		file_cache_remove_fd(fc, fd);
 		}
 }