Committer  : isomer
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Commit time: 2006-01-06 11:39:14 UTC

Modified files:
     ChangeLog ircd/crule.c ircd/ircd.c ircd/ircd_alloc.c ircd/motd.c
     ircd/s_conf.c ircd/uping.c

Log message:

Author: Isomer <[EMAIL PROTECTED]>
Log message:

Convert more Debug(())'s to log_write's, particularly ones that admins
should know about without having to run their server in debug mode.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.765 ircu2.10/ChangeLog:1.766
--- ircu2.10/ChangeLog:1.765    Fri Jan  6 03:22:27 2006
+++ ircu2.10/ChangeLog  Fri Jan  6 03:39:04 2006
@@ -1,4 +1,9 @@
 2006-01-07  Perry Lorier <[EMAIL PROTECTED]>
+       * ircd/crule.c ircd/ircd.c ircd/ircd_alloc.c ircd/motd.c ircd/s_conf.c
+         ircd/uping.c: Convert DEBUG's to log_write's 
+
+
+2006-01-07  Perry Lorier <[EMAIL PROTECTED]>
 
        * ircd/*.c include/*.h: Add static to functions where possible,
        removing the occasional completely unused function.
Index: ircu2.10/ircd/crule.c
diff -u ircu2.10/ircd/crule.c:1.10 ircu2.10/ircd/crule.c:1.11
--- ircu2.10/ircd/crule.c:1.10  Fri Jan  6 03:22:31 2006
+++ ircu2.10/ircd/crule.c       Fri Jan  6 03:39:04 2006
@@ -1,7 +1,7 @@
 /**
  * @file
  * @brief Connection rule parser and checker
- * @version $Id: crule.c,v 1.10 2006/01/06 11:22:31 isomer Exp $
+ * @version $Id: crule.c,v 1.11 2006/01/06 11:39:04 isomer Exp $
  *
  * by Tony Vencill (Tonto on IRC) <[EMAIL PROTECTED]>
  *
@@ -64,6 +64,7 @@
 #include "ircd.h"
 #include "ircd_alloc.h"
 #include "ircd_chattr.h"
+#include "ircd_log.h"
 #include "ircd_string.h"
 #include "match.h"
 #include "s_bsd.h"
@@ -454,7 +455,8 @@
   if (ruleroot != NULL)
     crule_free(&ruleroot);
 #if !defined(CR_DEBUG) && !defined(CR_CHKCONF)
-  Debug((DEBUG_ERROR, "%s in rule: %s", crule_errstr[errcode], rule));
+  log_write(LS_CONFIG, L_WARNING, 0, "%s in rule: %s", 
+                 crule_errstr[errcode], rule);
 #else
   fprintf(stderr, "%s in rule: %s\n", crule_errstr[errcode], rule);
 #endif
Index: ircu2.10/ircd/ircd.c
diff -u ircu2.10/ircd/ircd.c:1.95 ircu2.10/ircd/ircd.c:1.96
--- ircu2.10/ircd/ircd.c:1.95   Fri Jan  6 03:22:31 2006
+++ ircu2.10/ircd/ircd.c        Fri Jan  6 03:39:04 2006
@@ -19,7 +19,7 @@
  */
 /** @file
  * @brief Entry point and other initialization functions for the daemon.
- * @version $Id: ircd.c,v 1.95 2006/01/06 11:22:31 isomer Exp $
+ * @version $Id: ircd.c,v 1.96 2006/01/06 11:39:04 isomer Exp $
  */
 #include "config.h"
 
@@ -731,7 +731,8 @@
 
   debug_init(thisServer.bootopt & BOOT_TTY);
   if (check_pid()) {
-    Debug((DEBUG_FATAL, "Failed to acquire PID file lock after fork"));
+    log_write(LS_SYSTEM, L_CRIT, 0, 
+                   "Failed to acquire PID file lock after fork");
     return 2;
   }
 
Index: ircu2.10/ircd/ircd_alloc.c
diff -u ircu2.10/ircd/ircd_alloc.c:1.10 ircu2.10/ircd/ircd_alloc.c:1.11
--- ircu2.10/ircd/ircd_alloc.c:1.10     Wed Jan 26 20:07:46 2005
+++ ircu2.10/ircd/ircd_alloc.c  Fri Jan  6 03:39:04 2006
@@ -21,7 +21,7 @@
  */
 /** @file
  * @brief IRC daemon memory allocation functions.
- * @version $Id: ircd_alloc.c,v 1.10 2005/01/27 04:07:46 entrope Exp $
+ * @version $Id: ircd_alloc.c,v 1.11 2006/01/06 11:39:04 isomer Exp $
  */
 #include "config.h"
 
@@ -42,6 +42,7 @@
 static void
 nomem_handler(void)
 {
+  log_write(LS_SYSTEM, L_CRIT, 0, "Out of memory, exiting");
 #ifdef MDEBUG
   assert(0);
 #else
Index: ircu2.10/ircd/motd.c
diff -u ircu2.10/ircd/motd.c:1.22 ircu2.10/ircd/motd.c:1.23
--- ircu2.10/ircd/motd.c:1.22   Mon May  9 20:43:08 2005
+++ ircu2.10/ircd/motd.c        Fri Jan  6 03:39:04 2006
@@ -23,7 +23,7 @@
  */
 /** @file
  * @brief Message-of-the-day manipulation implementation.
- * @version $Id: motd.c,v 1.22 2005/05/10 03:43:08 entrope Exp $
+ * @version $Id: motd.c,v 1.23 2006/01/06 11:39:04 isomer Exp $
  */
 #include "config.h"
 
@@ -138,8 +138,8 @@
 
   /* gotta read in the file, now */
   if (!(file = fbopen(motd->path, "r"))) {
-    Debug((DEBUG_ERROR, "Couldn't open \"%s\": %s", motd->path,
-          strerror(errno)));
+    log_write(LS_SYSTEM, L_WARNING, 0, "Couldn't open \"%s\": %s", motd->path,
+          strerror(errno));
     return 0;
   }
 
Index: ircu2.10/ircd/s_conf.c
diff -u ircu2.10/ircd/s_conf.c:1.85 ircu2.10/ircd/s_conf.c:1.86
--- ircu2.10/ircd/s_conf.c:1.85 Fri Jan  6 03:22:31 2006
+++ ircu2.10/ircd/s_conf.c      Fri Jan  6 03:39:04 2006
@@ -19,7 +19,7 @@
  */
 /** @file
  * @brief ircd configuration file driver
- * @version $Id: s_conf.c,v 1.85 2006/01/06 11:22:31 isomer Exp $
+ * @version $Id: s_conf.c,v 1.86 2006/01/06 11:39:04 isomer Exp $
  */
 #include "config.h"
 
@@ -265,14 +265,14 @@
 lookup_confhost(struct ConfItem *aconf)
 {
   if (EmptyString(aconf->host) || EmptyString(aconf->name)) {
-    Debug((DEBUG_ERROR, "Host/server name error: (%s) (%s)",
-           aconf->host, aconf->name));
+    log_write(LS_CONFIG, L_WARNING, 0, "Host/server name error: (%s) (%s)",
+           aconf->host, aconf->name);
     return;
   }
   if (aconf->origin_name
       && !ircd_aton(&aconf->origin.addr, aconf->origin_name)) {
-    Debug((DEBUG_ERROR, "Origin name error: (%s) (%s)",
-        aconf->origin_name, aconf->name));
+    log_write(LS_CONFIG, L_WARNING, 0, "Origin name error: (%s) (%s)",
+        aconf->origin_name, aconf->name);
   }
   /*
    * Do name lookup now on hostnames given and store the
@@ -280,8 +280,8 @@
    */
   if (IsIP6Char(*aconf->host)) {
     if (!ircd_aton(&aconf->address.addr, aconf->host)) {
-      Debug((DEBUG_ERROR, "Host/server name error: (%s) (%s)",
-          aconf->host, aconf->name));
+      log_write(LS_CONFIG, L_WARNING, 0, "Host/server name error: (%s) (%s)",
+          aconf->host, aconf->name);
     }
   }
   else
Index: ircu2.10/ircd/uping.c
diff -u ircu2.10/ircd/uping.c:1.25 ircu2.10/ircd/uping.c:1.26
--- ircu2.10/ircd/uping.c:1.25  Fri Jan  6 03:22:31 2006
+++ ircu2.10/ircd/uping.c       Fri Jan  6 03:39:04 2006
@@ -18,7 +18,7 @@
  */
 /** @file
  * @brief UDP ping implementation.
- * @version $Id: uping.c,v 1.25 2006/01/06 11:22:31 isomer Exp $
+ * @version $Id: uping.c,v 1.26 2006/01/06 11:39:04 isomer Exp $
  */
 #include "config.h"
 
@@ -142,7 +142,8 @@
     return -1;
   if (!socket_add(&upingSock_v4, uping_echo_callback, 0, SS_DATAGRAM,
                   SOCK_EVENT_READABLE, fd)) {
-    Debug((DEBUG_ERROR, "UPING: Unable to queue fd to event system"));
+    log_write(LS_SYSTEM, L_WARNING, 0,
+                   "UPING: Unable to queue fd to event system");
     close(fd);
     return -1;
   }
@@ -155,7 +156,8 @@
     return -1;
   if (!socket_add(&upingSock_v6, uping_echo_callback, 0, SS_DATAGRAM,
                   SOCK_EVENT_READABLE, fd)) {
-    Debug((DEBUG_ERROR, "UPING: Unable to queue fd to event system"));
+    log_write(LS_SYSTEM, L_WARNING, 0, 
+                   "UPING: Unable to queue fd to event system");
     close(fd);
     return -1;
   }
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to