*
*/
+LogManager::LogManager()
+{
+ noforkstream = NULL;
+ Logging = false;
+}
+
+LogManager::~LogManager()
+{
+ if (noforkstream)
+ {
+ ServerInstance->Logs = this;
+ delete noforkstream;
+ ServerInstance->Logs = NULL;
+ }
+}
+
void LogManager::SetupNoFork()
{
if (!noforkstream)
{
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)
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");