[cvslog] [CVS] Module eggdrop1.6: Change committed

cvs at eggheads.org cvs at eggheads.org
Fri Jan 15 13:52:00 CST 2010


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2010-01-15 19:51:59 UTC
Committer  : Rumen Stoyanov <pseudo at egg6.net>

Modified files:
     eggdrop.conf doc/Changes1.6 doc/html/egg-core.html
     doc/settings/core.settings help/core.help help/set/cmds1.help
     src/eggdrop.h src/main.c src/misc.c src/patch.h src/tcl.c
     src/mod/channels.mod/channels.c

Log message:

Replaced the LOG_TS definition with a config variable "timestamp-format", defaulting to "[%H:%M:%S]".

Added support for silent backups and logfile switching with higher quiet-save values.

Patch by: pseudo

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/Changes1.6
diff -u eggdrop1.6/doc/Changes1.6:1.56 eggdrop1.6/doc/Changes1.6:1.57
--- eggdrop1.6/doc/Changes1.6:1.56	Sun Jan 10 16:28:56 2010
+++ eggdrop1.6/doc/Changes1.6	Fri Jan 15 13:51:49 2010
@@ -1,4 +1,4 @@
-$Id: Changes1.6,v 1.56 2010/01/10 22:28:56 pseudo Exp $
+$Id: Changes1.6,v 1.57 2010/01/15 19:51:49 pseudo Exp $
 
 Eggdrop Changes (since version 1.6.0)
 
@@ -6,6 +6,12 @@
 
 1.6.20 (CVS):
 
+  - Replaced the LOG_TS definition with a config variable "timestamp-format",
+    defaulting to "[%H:%M:%S]".
+  - Added support for silent backups and logfile switching with higher
+    quiet-save values.
+    Patch by: pseudo
+
   - Moved strict-host documentation to the core section, where it belongs and
     added a warning to discourage it's usage in the future.
   - Rewrote fixfrom() to not modify it's string argument.
Index: eggdrop1.6/doc/html/egg-core.html
diff -u eggdrop1.6/doc/html/egg-core.html:1.47 eggdrop1.6/doc/html/egg-core.html:1.48
--- eggdrop1.6/doc/html/egg-core.html:1.47	Sun Jan 10 16:28:57 2010
+++ eggdrop1.6/doc/html/egg-core.html	Fri Jan 15 13:51:49 2010
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<!-- $Id: egg-core.html,v 1.47 2010/01/10 22:28:57 pseudo Exp $ -->
+<!-- $Id: egg-core.html,v 1.48 2010/01/15 19:51:49 pseudo Exp $ -->
 
 <html>
   <head>
@@ -379,6 +379,15 @@
           <p>Use this feature to timestamp entries in the log file.</p>
         </dd>
 
+        <dt><strong>set timestamp-format &quot;[%H:%M:%S]&quot;</strong></dt>
+
+        <dd>
+          <p>Set the following to the timestamp for the logfile entries.
+          Popular times might be "[%H:%M]" (hour,min), or "[%H:%M:%S]"
+          (hour, min, sec). Read `man strftime' for more formatting
+          options. Keep it below 32 chars.</p>
+        </dd>
+
         <dt><strong>set keep-all-logs 0</strong></dt>
 
         <dd>
@@ -400,9 +409,13 @@
         <dt><strong>set quiet-save 0</strong></dt>
 
         <dd>
-          <p>Those nasty &quot;Writing user file...&quot; and &quot;Writing
-          channel file...&quot; messages won&#39;t be logged anymore if this
-          option is enabled.</p>
+          <p>&quot;Writing user file...&quot; and &quot;Writing channel
+          file...&quot; messages won't be logged anymore if this option is
+          enabled. If you set it to 2, the &quot;Backing up user file...&quot;
+          and &quot;Backing up channel file...&quot; messages will also not be
+          logged. In addition to this, you can disable the &quot;Switching
+          logfiles...&quot; and the new date message at midnight, by setting
+          this to 3.</p>
         </dd>
 
         <dt><strong>set logfile-suffix &quot;.%d%b%Y&quot;</strong></dt>
Index: eggdrop1.6/doc/settings/core.settings
diff -u eggdrop1.6/doc/settings/core.settings:1.41 eggdrop1.6/doc/settings/core.settings:1.42
--- eggdrop1.6/doc/settings/core.settings:1.41	Sun Jan 10 16:28:57 2010
+++ eggdrop1.6/doc/settings/core.settings	Fri Jan 15 13:51:49 2010
@@ -1,4 +1,4 @@
-$Id: core.settings,v 1.41 2010/01/10 22:28:57 pseudo Exp $
+$Id: core.settings,v 1.42 2010/01/15 19:51:49 pseudo Exp $
 
 Eggdrop Core Settings
 Last revised: April 17, 2003
@@ -166,6 +166,12 @@
       Use this feature to timestamp entries in the log file.
 
 
+    set timestamp-format "[%H:%M:%S]"
+      Set the following to the timestamp for the logfile entries. Popular times
+      might be "[%H:%M]" (hour, min), or "[%H:%M:%S]" (hour, min, sec).
+      Read `man strftime' for more formatting options.  Keep it below 32 chars.
+
+
     set keep-all-logs 0
       If you want to keep your logfiles forever, turn this setting on. All
       logfiles will get the suffix
@@ -181,8 +187,11 @@
 
 
     set quiet-save 0
-      Those nasty "Writing user file..." and "Writing channel file..." messages
-      won't be logged anymore if this option is enabled.
+      "Writing user file..." and "Writing channel file..." messages won't be
+      logged anymore if this option is enabled. If you set it to 2, the
+      "Backing up user file..." and "Backing up channel file..." messages will
+      also not be logged. In addition to this, you can disable the "Switching
+      logfiles..." and the new date message at midnight, by setting this to 3.
 
 
     set logfile-suffix ".%d%b%Y"
Index: eggdrop1.6/eggdrop.conf
diff -u eggdrop1.6/eggdrop.conf:1.60 eggdrop1.6/eggdrop.conf:1.61
--- eggdrop1.6/eggdrop.conf:1.60	Sun Jan 10 16:28:56 2010
+++ eggdrop1.6/eggdrop.conf	Fri Jan 15 13:51:48 2010
@@ -1,7 +1,7 @@
 #! /path/to/executable/eggdrop
 # ^- This should contain a fully qualified path to your Eggdrop executable.
 #
-# $Id: eggdrop.conf,v 1.60 2010/01/10 22:28:56 pseudo Exp $
+# $Id: eggdrop.conf,v 1.61 2010/01/15 19:51:48 pseudo Exp $
 #
 # This is a sample Eggdrop configuration file which includes all possible
 # settings that can be used to configure your bot.
@@ -137,6 +137,11 @@
 # Use this feature to timestamp entries in the log file.
 set log-time 1
 
+# Set the following to the timestamp for the logfile entries. Popular times
+# might be "[%H:%M]" (hour, min), or "[%H:%M:%S]" (hour, min, sec).
+# Read `man strftime' for more formatting options.  Keep it below 32 chars.
+set timestamp-format "[%H:%M:%S]"
+
 # If you want to keep your logfiles forever, turn this setting on. All
 # logfiles will get suffix ".[day, 2 digits][month, 3 letters][year, 4 digits]".
 # Note that your quota/hard-disk might be filled by this, so check your
@@ -155,8 +160,11 @@
 # 03:00 (AM).
 set switch-logfiles-at 300
 
-# "Writing user file..." and "Writing channel file..." messages won't be
-# logged anymore if this option is enabled.
+# "Writing user file..." and "Writing channel file..." messages won't be logged
+# anymore if this option is enabled. If you set it to 2, the "Backing up user
+# file..." and "Backing up channel file..." messages will also not be logged.
+# In addition to this, you can disable the "Switching logfiles..." and the new
+# date message at midnight, by setting this to 3.
 set quiet-save 0
 
 
Index: eggdrop1.6/help/core.help
diff -u eggdrop1.6/help/core.help:1.20 eggdrop1.6/help/core.help:1.21
--- eggdrop1.6/help/core.help:1.20	Mon May 31 18:59:47 2004
+++ eggdrop1.6/help/core.help	Fri Jan 15 13:51:49 2010
@@ -176,6 +176,7 @@
 console
 default-flags
 log-time
+timestamp-format
 max-logsize
 quick-logs
 logfile-suffix
Index: eggdrop1.6/help/set/cmds1.help
diff -u eggdrop1.6/help/set/cmds1.help:1.13 eggdrop1.6/help/set/cmds1.help:1.14
--- eggdrop1.6/help/set/cmds1.help:1.13	Sun Jan 10 16:28:57 2010
+++ eggdrop1.6/help/set/cmds1.help	Fri Jan 15 13:51:49 2010
@@ -169,6 +169,12 @@
 %{help=set log-time}%{+n}
 ###  %bset log-time%b <0/1>
    Use this feature to timestamp entries in the log file.
+%{help=set timestamp-format}%{+n}
+###  %bset timestamp-format%b <format>
+   Set the following to the timestamp for the logfile entries. Popular
+   times might be "[%H:%M]" (hour,min), or "[%H:%M:%S]" (hour, min, sec).
+   Read `man strftime' for more formatting options.  Keep it below 32
+   chars.
 %{help=set max-logsize}%{+n}
 ###  %bset max-logsize%b <filesize>
    This is the maximum size of your logfiles. Set it to 0 to disable.
@@ -190,9 +196,13 @@
    strftime manpages for more options. NOTE: On systems which don't
    support strftime, the default format will be used _always_.
 %{help=set quiet-save}%{+n}
-###  %bset quiet-save%b <0/1>
-   "Writing user file..." and "Writing channel file..." messages
-   won't be logged anymore if this option is enabled.
+###  %bset quiet-save%b <0/1/2/3>
+   "Writing user file..." and "Writing channel file..." messages won't
+   be logged anymore if this option is enabled. If you set it to 2, the
+   "Backing up user file..." and "Backing up channel file..." messages
+   will also not be logged. In addition to this, you can disable the
+   "Switching logfiles..." and the new date message at midnight, by
+   setting this to 3.
 %{help=set sort-users}%{+n}
 ###  %bset sort-users%b <0/1>
    If you want your userfile to be sorted upon saving, enable this
Index: eggdrop1.6/src/eggdrop.h
diff -u eggdrop1.6/src/eggdrop.h:1.72 eggdrop1.6/src/eggdrop.h:1.73
--- eggdrop1.6/src/eggdrop.h:1.72	Mon Jan  4 07:15:11 2010
+++ eggdrop1.6/src/eggdrop.h	Fri Jan 15 13:51:49 2010
@@ -4,7 +4,7 @@
  *
  *   IF YOU ALTER THIS FILE, YOU NEED TO RECOMPILE THE BOT.
  *
- * $Id: eggdrop.h,v 1.72 2010/01/04 13:15:11 pseudo Exp $
+ * $Id: eggdrop.h,v 1.73 2010/01/15 19:51:49 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -37,13 +37,6 @@
 /* DEBUG_CONTEXT is now set in config.h by configure */
 
 /*
- * Set the following to the timestamp for the logfile entries.
- * Popular times might be "[%H:%M]" (hour, min), or "[%H:%M:%S]" (hour, min, sec)
- * Read `man strftime' for more formatting options.  Keep it below 32 chars.
- */
-#define LOG_TS "[%H:%M]"
-
-/*
  * HANDLEN note:
  *       HANDLEN defines the maximum length a handle on the bot can be.
  *       Standard (and minimum) is 9 characters long.
Index: eggdrop1.6/src/main.c
diff -u eggdrop1.6/src/main.c:1.128 eggdrop1.6/src/main.c:1.129
--- eggdrop1.6/src/main.c:1.128	Sun Jan  3 07:27:32 2010
+++ eggdrop1.6/src/main.c	Fri Jan 15 13:51:49 2010
@@ -5,7 +5,7 @@
  *   command line arguments
  *   context and assert debugging
  *
- * $Id: main.c,v 1.128 2010/01/03 13:27:32 pseudo Exp $
+ * $Id: main.c,v 1.129 2010/01/15 19:51:49 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -73,7 +73,8 @@
 #endif
 
 extern char origbotname[], userfile[], botnetnick[];
-extern int dcc_total, conmask, cache_hit, cache_miss, max_logs, quick_logs;
+extern int dcc_total, conmask, cache_hit, cache_miss, max_logs, quick_logs,
+           quiet_save;
 extern struct dcc_t *dcc;
 extern struct userrec *userlist;
 extern struct chanset_t *chanset;
@@ -501,7 +502,8 @@
 {
   char s[125];
 
-  putlog(LOG_MISC, "*", USERF_BACKUP);
+  if (quiet_save < 2)
+    putlog(LOG_MISC, "*", USERF_BACKUP);
   egg_snprintf(s, sizeof s, "%s~bak", userfile);
   copyfile(userfile, s);
 }
@@ -565,7 +567,8 @@
         int j;
 
         strncpyz(s, ctime(&now), sizeof s);
-        putlog(LOG_ALL, "*", "--- %.11s%s", s, s + 20);
+        if (quiet_save < 3)
+          putlog(LOG_ALL, "*", "--- %.11s%s", s, s + 20);
         call_hook(HOOK_BACKUP);
         for (j = 0; j < max_logs; j++) {
           if (logs[j].filename != NULL && logs[j].f != NULL) {
@@ -583,7 +586,8 @@
     if (miltime == switch_logfiles_at) {
       call_hook(HOOK_DAILY);
       if (!keep_all_logs) {
-        putlog(LOG_MISC, "*", MISC_LOGSWITCH);
+        if (quiet_save < 3)
+          putlog(LOG_MISC, "*", MISC_LOGSWITCH);
         for (i = 0; i < max_logs; i++)
           if (logs[i].filename) {
             char s[1024];
Index: eggdrop1.6/src/misc.c
diff -u eggdrop1.6/src/misc.c:1.83 eggdrop1.6/src/misc.c:1.84
--- eggdrop1.6/src/misc.c:1.83	Sun Jan  3 07:27:32 2010
+++ eggdrop1.6/src/misc.c	Fri Jan 15 13:51:49 2010
@@ -7,7 +7,7 @@
  *   help system
  *   motd display and %var substitution
  *
- * $Id: misc.c,v 1.83 2010/01/03 13:27:32 pseudo Exp $
+ * $Id: misc.c,v 1.84 2010/01/15 19:51:49 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -55,6 +55,7 @@
 extern time_t now;
 extern Tcl_Interp *interp;
 
+char log_ts[32] = "[%H:%M:%S]"; /* Timestamp format for logfile entries */
 
 int shtime = 1;                 /* Display the time with console output */
 log_t *logs = 0;                /* Logfiles */
@@ -529,7 +530,7 @@
   /* Create the timestamp */
   t = localtime(&now2);
   if (shtime) {
-    egg_strftime(stamp, sizeof(stamp) - 2, LOG_TS, t);
+    egg_strftime(stamp, sizeof(stamp) - 2, log_ts, t);
     strcat(stamp, " ");
     tsl = strlen(stamp);
   }
@@ -707,7 +708,7 @@
          */
         char stamp[33];
 
-        egg_strftime(stamp, sizeof(stamp) - 1, LOG_TS, localtime(&now));
+        egg_strftime(stamp, sizeof(stamp) - 1, log_ts, localtime(&now));
         fprintf(logs[i].f, "%s ", stamp);
         fprintf(logs[i].f, MISC_LOGREPEAT, logs[i].repeats);
         /* Reset repeats */
Index: eggdrop1.6/src/mod/channels.mod/channels.c
diff -u eggdrop1.6/src/mod/channels.mod/channels.c:1.101 eggdrop1.6/src/mod/channels.mod/channels.c:1.102
--- eggdrop1.6/src/mod/channels.mod/channels.c:1.101	Thu Jan  7 07:48:31 2010
+++ eggdrop1.6/src/mod/channels.mod/channels.c	Fri Jan 15 13:51:49 2010
@@ -2,7 +2,7 @@
  * channels.c -- part of channels.mod
  *   support for channels within the bot
  *
- * $Id: channels.c,v 1.101 2010/01/07 13:48:31 pseudo Exp $
+ * $Id: channels.c,v 1.102 2010/01/15 19:51:49 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -524,7 +524,8 @@
 {
   char s[125];
 
-  putlog(LOG_MISC, "*", "Backing up channel file...");
+  if (quiet_save < 2)
+    putlog(LOG_MISC, "*", "Backing up channel file...");
   egg_snprintf(s, sizeof s, "%s~bak", chanfile);
   copyfile(chanfile, s);
 }
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.1228 eggdrop1.6/src/patch.h:1.1229
--- eggdrop1.6/src/patch.h:1.1228	Sun Jan 10 16:28:57 2010
+++ eggdrop1.6/src/patch.h	Fri Jan 15 13:51:49 2010
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.1228 2010/01/10 22:28:57 pseudo Exp $
+ * $Id: patch.h,v 1.1229 2010/01/15 19:51:49 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1263162488");            /* current unixtime */
+patch("1263584963");            /* current unixtime */
 /*
  *
  *
  */
-patch("fixfrom");
+patch("logts");
 /*
  *
  *
Index: eggdrop1.6/src/tcl.c
diff -u eggdrop1.6/src/tcl.c:1.93 eggdrop1.6/src/tcl.c:1.94
--- eggdrop1.6/src/tcl.c:1.93	Thu Jan  7 07:48:31 2010
+++ eggdrop1.6/src/tcl.c	Fri Jan 15 13:51:49 2010
@@ -4,7 +4,7 @@
  *   Tcl initialization
  *   getting and setting Tcl/eggdrop variables
  *
- * $Id: tcl.c,v 1.93 2010/01/07 13:48:31 pseudo Exp $
+ * $Id: tcl.c,v 1.94 2010/01/15 19:51:49 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -48,8 +48,8 @@
 extern char origbotname[], botuser[], motdfile[], admin[], userfile[],
             firewall[], helpdir[], notify_new[], hostname[], myip[], moddir[],
             tempdir[], owner[], network[], botnetnick[], bannerfile[],
-            egg_version[], natip[], configfile[], logfile_suffix[], textdir[],
-            pid_file[];
+            egg_version[], natip[], configfile[], logfile_suffix[], log_ts[],
+            textdir[], pid_file[];
 
 extern int flood_telnet_thr, flood_telnet_time, shtime, share_greet,
            require_p, keep_all_logs, allow_new_telnets, stealth_telnets,
@@ -501,6 +501,7 @@
   {"config",          configfile,     0,                       0},
   {"telnet-banner",   bannerfile,     120,           STR_PROTECT},
   {"logfile-suffix",  logfile_suffix, 20,                      0},
+  {"timestamp-format",log_ts,         32,                      0},
   {"pidfile",         pid_file,       120,           STR_PROTECT},
   {NULL,              NULL,           0,                       0}
 };
----------------------- End of diff -----------------------


More information about the Changes mailing list