summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-09-15 18:28:19 +0000
committerDan Winship <danw@src.gnome.org>2000-09-15 18:28:19 +0000
commit74b224ce32d013f5a6004ab5ca705cbf6f88fece (patch)
treefcb44dc0dc0e509d04d7dcc9bcbbde8e28e842e7
parent3731a29d75fce1f3692a1f2fa647814c926d77b1 (diff)
downloadevolution-data-server-evolution-0-5-branch.tar.gz
pull up no-debug-log fixEVOLUTION_0_5_1evolution-0-5-branch
-rw-r--r--camel/ChangeLog8
-rw-r--r--camel/camel-remote-store.c24
-rw-r--r--camel/camel.c7
3 files changed, 29 insertions, 10 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index d51706fa7..0f36940c4 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,11 @@
+2000-09-15 Dan Winship <danw@helixcode.com>
+
+ * camel.c (camel_init): Set camel_verbose_debug to TRUE if
+ CAMEL_VERBOSE_DEBUG is set in the environment.
+
+ * camel-remote-store.c (remote_send_line, remote_recv_line): only
+ log if camel_verbose_debug is TRUE.
+
2000-09-13 Dan Winship <danw@helixcode.com>
* providers/imap/camel-imap-folder.c (imap_expunge): Don't look at
diff --git a/camel/camel-remote-store.c b/camel/camel-remote-store.c
index afbd3a71c..16387c1c3 100644
--- a/camel/camel-remote-store.c
+++ b/camel/camel-remote-store.c
@@ -48,6 +48,9 @@
#include "string-utils.h"
#define d(x) x
+#if d(!)0
+extern gboolean camel_verbose_debug;
+#endif
#define CSRVC(obj) (CAMEL_SERVICE_CLASS (CAMEL_OBJECT_GET_CLASS (obj)))
#define CSTRC(obj) (CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS (obj)))
@@ -322,12 +325,14 @@ remote_send_string (CamelRemoteStore *store, CamelException *ex, char *fmt, va_l
cmdbuf = g_strdup_vprintf (fmt, ap);
#if d(!)0
- if (strncmp (cmdbuf, "PASS ", 5) == 0)
- fprintf (stderr, "sending : PASS xxxx\n");
- else if (strstr (cmdbuf, "LOGIN \""))
- fprintf (stderr, "sending : ---- LOGIN \"xxxx\" \"xxxx\"\n");
- else
- fprintf (stderr, "sending : %s", cmdbuf);
+ if (camel_verbose_debug) {
+ if (strncmp (cmdbuf, "PASS ", 5) == 0)
+ fprintf (stderr, "sending : PASS xxxx\n");
+ else if (strstr (cmdbuf, "LOGIN \""))
+ fprintf (stderr, "sending : ---- LOGIN \"xxxx\" \"xxxx\"\n");
+ else
+ fprintf (stderr, "sending : %s", cmdbuf);
+ }
#endif
if (camel_stream_printf (store->ostream, "%s", cmdbuf) == -1) {
@@ -461,8 +466,11 @@ remote_recv_line (CamelRemoteStore *store, char **dest, CamelException *ex)
camel_exception_clear (&dex);
return -1;
}
-
- d(fprintf (stderr, "received: %s\n", *dest));
+
+#if d(!)0
+ if (camel_verbose_debug)
+ fprintf (stderr, "received: %s\n", *dest);
+#endif
return 0;
}
diff --git a/camel/camel.c b/camel/camel.c
index 0121c1082..846d946b9 100644
--- a/camel/camel.c
+++ b/camel/camel.c
@@ -27,11 +27,11 @@
#include "camel.h"
#include <unicode.h>
+gboolean camel_verbose_debug = FALSE;
+
gint
camel_init(void)
{
-
-
#ifdef ENABLE_THREADS
#ifdef G_THREADS_ENABLED
g_thread_init (NULL);
@@ -40,6 +40,9 @@ camel_init(void)
#endif /* G_THREADS_ENABLED */
#endif /* ENABLE_THREADS */
+ if (getenv ("CAMEL_VERBOSE_DEBUG"))
+ camel_verbose_debug = TRUE;
+
unicode_init ();
return 0;