ChanServ seen fixes; other cleanups
[srvx.git] / src / log.c
index 35309792b249a959a65ec598b7dfd83559ef9abe..22804e84e233433cf30cfe2ed04d1c1360c6d2bc 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -1,11 +1,12 @@
 /* log.c - Diagnostic and error logging
  * Copyright 2000-2004 srvx Development Team
  *
- * This program is free software; you can redistribute it and/or modify
+ * This file is part of srvx.
+ *
+ * srvx is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.  Important limitations are
- * listed in the COPYING file that accompanies this software.
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -13,7 +14,8 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, email srvx-maintainers@srvx.net.
+ * along with srvx; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 
 #include "conf.h"
@@ -242,7 +244,7 @@ find_severity(const char *text)
  *   KEY := LOGSET '.' SEVSET
  *   LOGSET := LOGLIT | LOGLIT ',' LOGSET
  *   LOGLIT := a registered log type
- *   SEVSET := '*' | SEVLIT | '<' SEVLIT | '<=' SEVLIT | '>' SEVLIT | '>=' SEVLIT | SEVLIG ',' SEVSET
+ *   SEVSET := '*' | SEVLIT | '=' SEVLIT | '<' SEVLIT | '<=' SEVLIT | '>' SEVLIT | '>=' SEVLIT | SEVLIT ',' SEVSET
  *   SEVLIT := one of log_severity_names
  * A KEY contains the Cartesian product of the logs in its LOGSET
  * and the severities in its SEVSET.
@@ -303,6 +305,8 @@ log_parse_sevset(char *buffer, char targets[LOG_NUM_SEVERITIES])
                 }
             }
         } else {
+            if (buffer[0] == '=')
+                buffer++;
             bound = find_severity(buffer);
             targets[bound] = 1;
         }
@@ -367,7 +371,8 @@ log_conf_read(void)
                 for (ii = 0; ii < slist->used; ++ii) {
                     type = log_register_type(slist->list[ii], NULL);
                     for (sev = 0; sev < LOG_NUM_SEVERITIES; ++sev) {
-                        if (!sevset[sev]) continue;
+                        if (!sevset[sev])
+                            continue;
                         logList_join(&type->logs[sev], &logList);
                     }
                 }