Updated more modules to the new logging standard
authorArt Cancro <ajc@citadel.org>
Fri, 24 Mar 2017 20:48:33 +0000 (16:48 -0400)
committerArt Cancro <ajc@citadel.org>
Fri, 24 Mar 2017 20:48:33 +0000 (16:48 -0400)
citadel/config.c
citadel/control.c

index eadd6cb2fd990e9b9d840e040647fb689be5dfef..46105383bccbdb45333c4beb69fa5d1defdb2b0e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Read and write the citadel.config file
  *
- * Copyright (c) 1987-2016 by the citadel.org team
+ * Copyright (c) 1987-2017 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
@@ -29,8 +29,8 @@ void config_warn_if_port_unset(char *key, int default_port)                   \
        int p = CtdlGetConfigInt(key);
        if ((p < -1) || (p == 0) || (p > UINT16_MAX))
        {
-               syslog(LOG_EMERG,
-                       "configuration setting %s is not -1 (disabled) or a valid TCP-Port - check your config! Default setting is: %d",
+               syslog(LOG_ERR,
+                       "config: setting %s is not -1 (disabled) or a valid TCP-Port - check your config! Default setting is: %d",
                        key, default_port
                );
        }
@@ -41,12 +41,11 @@ void config_warn_if_empty(char *key)
 {
        if (IsEmptyStr(CtdlGetConfigStr(key)))
        {
-               syslog(LOG_EMERG, "configuration setting %s is empty, but must not - check your config!", key);
+               syslog(LOG_ERR, "config: setting %s is empty, but must not - check your config!", key);
        }
 }
 
 
-
 void validate_config(void) {
 
        /*
@@ -78,11 +77,11 @@ void validate_config(void) {
        config_warn_if_port_unset("c_nntps_port", 563);
 
        if (getpwuid(ctdluid) == NULL) {
-               syslog(LOG_EMERG, "The UID (%d) citadel is configured to use is not defined in your system (/etc/passwd?)!", ctdluid);
+               syslog(LOG_ERR, "config: UID (%d) citadel is configured to use is not defined in your system (/etc/passwd?)!", ctdluid);
        }
-       
 }
 
+
 /*
  * Put some sane default values into our configuration.  Some will be overridden when we run setup.
  */
@@ -143,7 +142,6 @@ void brand_new_installation_set_defaults(void) {
 }
 
 
-
 /*
  * Migrate a supplied legacy configuration to the new in-db format.
  * No individual site should ever have to do this more than once.
@@ -226,7 +224,6 @@ void migrate_legacy_config(struct legacy_config *lconfig)
 }
 
 
-
 /*
  * Called during the initialization of Citadel server.
  * It verifies the system's integrity and reads citadel.config into memory.
@@ -333,7 +330,6 @@ void initialize_config_system(void) {
 }
 
 
-
 /*
  * Called when Citadel server is shutting down.
  * Clears out the config hash table.
@@ -344,7 +340,6 @@ void shutdown_config_system(void)
 }
 
 
-
 /*
  * Set a system config value.  Simple key/value here.
  */
@@ -389,7 +384,6 @@ void CtdlSetConfigInt(char *key, int value)
 }
 
 
-
 /*
  * Delete a system config value.
  */
@@ -413,8 +407,6 @@ void CtdlDelConfig(char *key)
 }
 
 
-
-
 /*
  * Fetch a system config value.  Caller does *not* own the returned value and may not alter it.
  */
@@ -470,18 +462,6 @@ long CtdlGetConfigLong(char *key)
 }
 
 
-
-/**********************************************************************/
-
-
-
-
-
-
-
-
-
-
 void CtdlGetSysConfigBackend(long msgnum, void *userdata) {
        config_msgnum = msgnum;
 }
@@ -500,7 +480,6 @@ char *CtdlGetSysConfig(char *sysconfname) {
                return NULL;
        }
 
-
        /* We want the last (and probably only) config in this room */
        begin_critical_section(S_CONFIG);
        config_msgnum = (-1L);
@@ -537,4 +516,3 @@ char *CtdlGetSysConfig(char *sysconfname) {
 void CtdlPutSysConfig(char *sysconfname, char *sysconfdata) {
        CtdlWriteObject(SYSCONFIGROOM, sysconfname, sysconfdata, (strlen(sysconfdata)+1), NULL, 0, 1, 0);
 }
-
index 8e0b487265003d7db54c9d884a850ef40843444f..fce46a00cefdbd317a1ca2b76f60f4cb437b7fe7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This module handles states which are global to the entire server.
  *
- * Copyright (c) 1987-2016 by the citadel.org team
+ * Copyright (c) 1987-2017 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
@@ -83,10 +83,10 @@ void control_find_highest(struct ctdlroom *qrbuf, void *data)
        }
        cdb_free(cdbfr);
        if (room_fixed) {
-               syslog(LOG_INFO, "Control record checking....Fixed room counter\n");
+               syslog(LOG_INFO, "control: fixed room counter");
        }
        if (message_fixed) {
-               syslog(LOG_INFO, "Control record checking....Fixed message count\n");
+               syslog(LOG_INFO, "control: fixed message count");
        }
        return;
 }
@@ -106,7 +106,7 @@ void control_find_user (struct ctdluser *EachUser, void *out_data)
                user_fixed = 1;
        }
        if(user_fixed)
-               syslog(LOG_INFO, "Control record checking....Fixed user count\n");
+               syslog(LOG_INFO, "control: fixed user count");
 }
 
 
@@ -121,7 +121,7 @@ void migrate_legacy_control_record(void)
 
        fp = fopen(file_citadel_control, "rb+");
        if (fp != NULL) {
-               syslog(LOG_INFO, "Legacy format control record found -- importing to db");
+               syslog(LOG_INFO, "control: legacy format record found -- importing to db");
                fread(&c, sizeof(struct legacy_ctrl_format), 1, fp);
                
                CtdlSetConfigLong(      "MMhighest",                    c.MMhighest);
@@ -147,7 +147,7 @@ void migrate_legacy_control_record(void)
  */
 void check_control(void)
 {
-       syslog(LOG_INFO, "Sanity checking the recorded highest message, user, and room numbers\n");
+       syslog(LOG_INFO, "control: sanity checking the recorded highest message, user, and room numbers");
        CtdlForEachRoom(control_find_highest, NULL);
        ForEachUser(control_find_user, NULL);
 }