Disable debugging spew unless imap4:command is enabled.
authorJeffrey Stedfast <fejj@novell.com>
Wed, 19 Jan 2005 16:32:52 +0000 (16:32 +0000)
committerJeffrey Stedfast <fejj@src.gnome.org>
Wed, 19 Jan 2005 16:32:52 +0000 (16:32 +0000)
2005-01-19  Jeffrey Stedfast  <fejj@novell.com>

* providers/imap4/camel-imap4-command.c: Disable debugging spew
unless imap4:command is enabled.

camel/ChangeLog
camel/providers/imap4/camel-imap4-command.c

index 72211d0..44d539d 100644 (file)
@@ -1,5 +1,8 @@
 2005-01-19  Jeffrey Stedfast  <fejj@novell.com>
 
+       * providers/imap4/camel-imap4-command.c: Disable debugging spew
+       unless imap4:command is enabled.
+
        * camel-offline-folder.c (camel_offline_folder_downsync): Documented.
 
        * camel-offline-store.c (camel_offline_store_set_network_state):
index e869bee..438abd2 100644 (file)
@@ -39,7 +39,7 @@
 #include "camel-imap4-command.h"
 
 
-#define d(x) x
+#define d(x) (camel_debug ("imap4:command") ? (x) : 0)
 
 
 enum {
@@ -517,8 +517,7 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
                d(fprintf (stderr, "sending: %s ", ic->tag));
        }
        
-#if d(!)0
-       {
+       if (camel_debug ("imap4:command")) {
                int sending = ic->part != ic->parts;
                unsigned char *eoln, *eob;
                
@@ -541,7 +540,6 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
                        sending = 1;
                } while (linebuf < eob);
        }
-#endif
        
        linebuf = ic->part->buffer;
        len = ic->part->buflen;
@@ -634,22 +632,22 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
                                                goto exception;
                                }
                        } else {
-#if d(!)0
-                               fprintf (stderr, "expected anything but this: ");
-                               unexpected_token (&token);
-                               fprintf (stderr, "\n");
-#endif
+                               if (camel_debug ("imap4:command")) {
+                                       fprintf (stderr, "expected anything but this: ");
+                                       unexpected_token (&token);
+                                       fprintf (stderr, "\n");
+                               }
                                
                                goto unexpected;
                        }
                        
                        break;
                } else {
-#if d(!)0
-                       fprintf (stderr, "wtf is this: ");
-                       unexpected_token (&token);
-                       fprintf (stderr, "\n");
-#endif
+                       if (camel_debug ("imap4:command")) {
+                               fprintf (stderr, "wtf is this: ");
+                               unexpected_token (&token);
+                               fprintf (stderr, "\n");
+                       }
                        
                unexpected: