* A few logging hacks
authorArt Cancro <ajc@citadel.org>
Fri, 14 Jan 2005 21:03:18 +0000 (21:03 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 14 Jan 2005 21:03:18 +0000 (21:03 +0000)
webcit/ChangeLog
webcit/calendar_view.c
webcit/tcp_sockets.c
webcit/webcit.h

index 1512f4a5917ff2b42fc2d3b92aacb5565de0964c..56e5cfd153483a33670a30f5d4474006a02c442f 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 528.9  2005/01/14 21:03:17  ajc
+* A few logging hacks
+
 Revision 528.8  2005/01/14 15:00:51  ajc
 * Placed the navbar into the room banner, at least in its temporary form.
 
@@ -2179,3 +2182,4 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index 975d8c198454aab5432958755c5c3fcc04aa470b..52d335fa9fc10606f24e3cfd862b87bb0d0e77ad 100644 (file)
@@ -78,15 +78,14 @@ void calendar_month_view_display_events(time_t thetime) {
                                localtime_r(&event_tt, &event_tm);
                        }
 
-lprintf(9, "Event: %04d/%02d/%02d, Now: %04d/%02d/%02d\n",
-       event_tm.tm_year,
-       event_tm.tm_mon,
+lprintf(9, "Event: %04d-%s-%02d, Now: %04d-%s-%02d\n",
+       event_tm.tm_year + 1900,
+       ascmonths[event_tm.tm_mon],
        event_tm.tm_mday,
-       today_tm.tm_year,
-       today_tm.tm_mon,
+       today_tm.tm_year + 1900,
+       ascmonths[today_tm.tm_mon],
        today_tm.tm_mday);
 
-
                        if ((event_tm.tm_year == today_tm.tm_year)
                           && (event_tm.tm_mon == today_tm.tm_mon)
                           && (event_tm.tm_mday == today_tm.tm_mday)) {
index 42df6b96f90799888e48a1d05036b5cea458b60f..be956ae26f007a56ac4581b96f7b3710efa85453 100644 (file)
@@ -6,6 +6,10 @@
  * $Id$
  */
 
+/*
+ * Uncomment this to log all communications with the Citadel server
+ */
+#define SERV_TRACE 1
 
 #include <ctype.h>
 #include <stdlib.h>
@@ -174,7 +178,9 @@ void serv_gets(char *strbuf)
        } while ((ch != 10) && (ch != 0) && (len < (SIZ-1)));
        if (strbuf[len-1] == 10) strbuf[--len] = 0;
        if (strbuf[len-1] == 13) strbuf[--len] = 0;
-       /* lprintf(9, ">%s\n", strbuf); */
+#ifdef SERV_TRACE
+       lprintf(9, ">%s\n", strbuf);
+#endif
 }
 
 
@@ -210,6 +216,9 @@ void serv_puts(char *string)
 {
        char buf[SIZ];
 
+#ifdef SERV_TRACE
+       lprintf(9, "<%s\n", string);
+#endif
        sprintf(buf, "%s\n", string);
        serv_write(buf, strlen(buf));
 }
@@ -229,5 +238,7 @@ void serv_printf(const char *format,...)
 
        strcat(buf, "\n");
        serv_write(buf, strlen(buf));
-       /* lprintf(9, "<%s", buf); */
+#ifdef SERV_TRACE
+       lprintf(9, "<%s", buf);
+#endif
 }
index 5584880af8d1545dc079e1d1549c3e975ff99775..d436e8e74e9c4eb3a4fd5a9875118d2869a39e36 100644 (file)
@@ -479,6 +479,7 @@ int client_read_ssl(char *buf, int bytes, int timeout);
 void client_write_ssl(char *buf, int nbytes);
 #endif
 
+extern char *ascmonths[];
 
 
 /* Views (from citadel.h) */