]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/config.cpp
Made config.cpp output errors now that it's a true daemon!
[irc/gameservirc.git] / gameserv / config.cpp
index 97ae564c49bad7e4c41aa045f7eef95538bde21c..c43f01411faa2b0d1817067063a5c1cd03d54f84 100644 (file)
@@ -5,6 +5,8 @@
 #include "extern.h"
 
 using std::ifstream;
+using std::cerr;
+using std::endl;
 
 void load_config_file(char *config);
 void unload_config_file();
@@ -78,13 +80,14 @@ void load_config_file(char *config)
     if (infile.fail())
     {
        log("Error opening %s", config);
+       cerr << "Error opening " << config << endl;
        return;
     }
 
     while (infile.getline(buf, 1024, '\n'))
     {
        #ifdef DEBUGMODE
-           log("Buf: %s", buf);
+           log("Config file entry buf: %s", buf);
        #endif
 
        if (buf[0] == '#' || buf[0] == ' ' || buf[0] == '\0' || buf[0] == '\n' || buf[0] == '\r')
@@ -96,6 +99,8 @@ void load_config_file(char *config)
        {
            value = strtok(NULL, "");
            log("You should read the entire %s file!", config);
+           cerr << "You should read the entire " << config << " file!" 
+                << endl;
            exit(0);
        }
        if (stricmp(directive, "S_GAMESERV") == 0)
@@ -195,6 +200,8 @@ void load_config_file(char *config)
        {
            #ifdef DEBUGMODE
                log("Unknown Directive. Buffer: %s", buf);
+               cerr << "Unknown " << config << " directive. Buffer: " 
+                    << buf << endl;
            #endif
            continue;
        }