]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/logger.cpp
Fix bug #110
[user/henk/code/inspircd.git] / src / logger.cpp
index ac171027c4d0e044e002589bec530cd20c44a2cd..2e26823683ea0521df6a00c72a7ff29423cc4b16 100644 (file)
@@ -53,6 +53,11 @@ LogManager::~LogManager()
 
 void LogManager::OpenFileLogs()
 {
+       if (ServerInstance->Config->cmdline.forcedebug)
+       {
+               ServerInstance->Config->RawLog = true;
+               return;
+       }
        /* Skip rest of logfile opening if we are running -nolog. */
        if (!ServerInstance->Config->cmdline.writelog)
                return;
@@ -112,12 +117,15 @@ void LogManager::OpenFileLogs()
                        fw = fwi->second;
                }
                FileLogStream* fls = new FileLogStream(loglevel, fw);
+               fls->OnLog(SPARSE, "HEADER", InspIRCd::LogHeader);
                AddLogTypes(type, fls, true);
        }
 }
 
 void LogManager::CloseLogs()
 {
+       if (ServerInstance->Config && ServerInstance->Config->cmdline.forcedebug)
+               return;
        std::map<std::string, std::vector<LogStream*> >().swap(LogStreams); /* Clear it */
        std::map<LogStream*, std::vector<std::string> >().swap(GlobalLogStreams); /* Clear it */
        for (std::map<LogStream*, int>::iterator i = AllLogStreams.begin(); i != AllLogStreams.end(); ++i)