[cvslog] (2002-09-30 06:32:40 UTC) Module eggdrop1.6: Change committed

cvslog cvs at tsss.org
Mon Sep 30 01:33:00 CST 2002


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2002-09-30 06:32:40 UTC
Commited by: Will Buckner <wcc at techmonkeys.org>

Modified files:
     src/misc.c src/patch.h

Log message:

More logging optimizations. Patch by BarkerJr.

---------------------- diff included ----------------------
Index: eggdrop1.6/src/misc.c
diff -u eggdrop1.6/src/misc.c:1.50 eggdrop1.6/src/misc.c:1.51
--- eggdrop1.6/src/misc.c:1.50	Fri Sep 27 17:44:02 2002
+++ eggdrop1.6/src/misc.c	Mon Sep 30 01:32:30 2002
@@ -7,7 +7,7 @@
  *   help system
  *   motd display and %var substitution
  *
- * $Id: misc.c,v 1.50 2002/09/27 22:44:02 wcc Exp $
+ * $Id: misc.c,v 1.51 2002/09/30 06:32:30 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -482,8 +482,7 @@
 void putlog EGG_VARARGS_DEF(int, arg1)
 {
   int i, type, tsl;
-  char *format, *chname, s[LOGLINELEN], s1[256], *out;
-  char ct[81], *s2, stamp[32];
+  char *format, *chname, s[LOGLINELEN], s1[256], *out, ct[81], *s2, stamp[33];
   va_list va;
   struct tm *t = localtime(&now);
 
@@ -491,6 +490,7 @@
   chname = va_arg(va, char *);
   format = va_arg(va, char *);
 
+  /* Create the timestamp */
   strftime(&stamp[0], 32, LOG_TS, t);
   sprintf(&stamp[0], "%s ", stamp);
   tsl = strlen(stamp);
@@ -517,6 +517,7 @@
       }
     }
   }
+  /* Place the timestamp in the string to be printed */
   if ((out[0]) && (shtime)) {
     strncpy(&s[0], stamp, tsl);
     out = s;
@@ -642,7 +643,6 @@
 void flushlogs()
 {
   int i;
-  struct tm *t = localtime(&now);
 
   /* Logs may not be initialised yet. */
   if (!logs)
@@ -657,13 +657,10 @@
          /* Repeat.. if quicklogs used then display 'last message
           * repeated x times' and reset repeats.
 	  */
-	if (t) {
-	  fprintf(logs[i].f, "[%2.2d:%2.2d] ", t->tm_hour, t->tm_min);
-	  fprintf(logs[i].f, MISC_LOGREPEAT, logs[i].repeats);
-	} else {
-	  fprintf(logs[i].f, "[??:??] ");
-	  fprintf(logs[i].f, MISC_LOGREPEAT, logs[i].repeats);
-	}
+        char stamp[32];
+        strftime(&stamp[0], 32, LOG_TS, localtime(&now));
+	fprintf(logs[i].f, "%s ", stamp);
+	fprintf(logs[i].f, MISC_LOGREPEAT, logs[i].repeats);
 	/* Reset repeats */
 	logs[i].repeats = 0;
       }
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.833 eggdrop1.6/src/patch.h:1.834
--- eggdrop1.6/src/patch.h:1.833	Fri Sep 27 19:06:29 2002
+++ eggdrop1.6/src/patch.h	Mon Sep 30 01:32:30 2002
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.833 2002/09/28 00:06:29 wcc Exp $
+ * $Id: patch.h,v 1.834 2002/09/30 06:32:30 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1033171318");		/* current unixtime */
+patch("1033367202");		/* current unixtime */
 /*
  *
  *
  */
-patch("irccmds-cosmetic");
+patch("putlog-opt2");
 /*
  *
  *
----------------------- End of diff -----------------------



More information about the Changes mailing list