]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/helperfuncs.cpp
Fix for bug #376 - FEATURE - (sorry w00t) - not backporting to stable.
[user/henk/code/inspircd.git] / src / helperfuncs.cpp
index 0bcee07116a6421bce99f3fc9ccd3f2093f27794..9363e33764aa3cf5a1a5b2914e01d028854a5160 100644 (file)
@@ -31,7 +31,7 @@ static time_t LAST = 0;
 void InspIRCd::Log(int level, const char* text, ...)
 {
        /* sanity check, just in case */
-       if (!this->Config)
+       if (!this->Config || !this->Logger)
                return;
 
        /* Do this check again here so that we save pointless vsnprintf calls */
@@ -51,7 +51,7 @@ void InspIRCd::Log(int level, const char* text, ...)
 void InspIRCd::Log(int level, const std::string &text)
 {
        /* sanity check, just in case */
-       if (!this->Config)
+       if (!this->Config || !this->Logger)
                return;
 
        /* If we were given -debug we output all messages, regardless of configured loglevel */
@@ -389,7 +389,7 @@ bool InspIRCd::IsChannel(const char *chname)
 }
 
 /* true for valid nickname, false else */
-bool InspIRCd::IsNick(const char* n)
+bool IsNickHandler::Call(const char* n)
 {
        if (!n || !*n)
                return false;
@@ -418,7 +418,7 @@ bool InspIRCd::IsNick(const char* n)
 }
 
 /* return true for good ident, false else */
-bool InspIRCd::IsIdent(const char* n)
+bool IsIdentHandler::Call(const char* n)
 {
        if (!n || !*n)
                return false;
@@ -442,7 +442,7 @@ bool InspIRCd::IsIdent(const char* n)
 }
 
 /* open the proper logfile */
-void InspIRCd::OpenLog(char** argv, int argc)
+bool InspIRCd::OpenLog(char** argv, int argc)
 {
        Config->MyDir = Config->GetFullProgDir();
 
@@ -462,11 +462,12 @@ void InspIRCd::OpenLog(char** argv, int argc)
 
        if (!Config->log_file)
        {
-               printf("ERROR: Could not write to logfile %s: %s\n\n", Config->logpath.c_str(), strerror(errno));
-               Exit(EXIT_STATUS_LOG);
+               this->Logger = NULL;
+               return false;
        }
 
        this->Logger = new FileLogger(this, Config->log_file);
+       return true;
 }
 
 void InspIRCd::CheckRoot()