]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/logger.cpp
Move ugly .*.inc files into make/template/ where they can be more easily found
[user/henk/code/inspircd.git] / src / logger.cpp
index c9b1cf9e492a5bf8bc4f21c874b96078d2baec54..19e07e78f64188b5b08e2724ced28d08f853409d 100644 (file)
  *
  */
 
+LogManager::LogManager()
+{
+       noforkstream = NULL;
+       Logging = false;
+}
+
+LogManager::~LogManager()
+{
+       if (noforkstream)
+       {
+               ServerInstance->Logs = this;
+               delete noforkstream;
+               ServerInstance->Logs = NULL;
+       }
+}
+
 void LogManager::SetupNoFork()
 {
        if (!noforkstream)
@@ -68,7 +84,7 @@ void LogManager::OpenFileLogs()
        {
                return;
        }
-       ConfigReader* Conf = new ConfigReader;
+       ConfigReader Conf;
        std::map<std::string, FileWriter*> logmap;
        std::map<std::string, FileWriter*>::iterator i;
        for (int index = 0;; ++index)
@@ -106,7 +122,7 @@ void LogManager::OpenFileLogs()
                        loglevel = NONE;
                }
                FileWriter* fw;
-               std::string target = Conf->ReadValue("log", "target", index);
+               std::string target = Conf.ReadValue("log", "target", index);
                if ((i = logmap.find(target)) == logmap.end())
                {
                        FILE* f = fopen(target.c_str(), "a");