shithub: riscv

Download patch

ref: c03079ad08b8c6441a6b1bf2e032844aae679e08
parent: ea98dafce5b5657cfd65a3a5210c46bcda367525
author: Ori Bernstein <[email protected]>
date: Sun Jul 26 15:12:48 EDT 2020

upasfs: make imap debug logging less noisy

The current logging prints a debug line for every
message in an inbox, which is unusably verbose.
This removes the prints for unchanged messages,
and adds a print for flag changes.

--- a/sys/src/cmd/upas/fs/imap.c
+++ b/sys/src/cmd/upas/fs/imap.c
@@ -979,7 +979,6 @@
 				m->imapuid = strtoull(m->idxaux, 0, 0);
 			c = vcmp(f[i].uid, m->imapuid);
 		}
-		idprint(imap, "consider %U and %U -> %d\n", i<n? f[i].uid: 0, m? m->imapuid: 1, c);
 		if(c < 0){
 			/* new message */
 			idprint(imap, "new: %U (%U)\n", f[i].uid, m? m->imapuid: 0);
@@ -1006,8 +1005,10 @@
 			m->deleted = Disappear;
 			ll = &m->next;
 		}else{
-			if((m->flags & ~Frecent) != (f[i].flags & ~Frecent))
+			if((m->flags & ~Frecent) != (f[i].flags & ~Frecent)){
+				idprint(imap, "modified: %d != %d\n", m->flags, f[i].flags);
 				m->cstate |= Cmod;
+			}
 			m->flags = f[i].flags;
 			ll = &m->next;
 			i++;