X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fhelperfuncs.cpp;h=94ba6a03728e42d989f313b33abf49d8d141bd12;hb=0f87ad0d4b97874823c94a5168a06dcd444ad559;hp=eced0c56a10b942f87d048335897e0f2c1fffde5;hpb=9924e5631193ad581d885380fd11ae8bfb91fa0b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index eced0c56a..94ba6a037 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -276,36 +276,19 @@ bool IsSIDHandler::Call(const std::string &str) /* open the proper logfile */ bool InspIRCd::OpenLog(char**, int) { - /* This function only happens at startup now */ - if (Config->nofork) - { - this->Logs->SetupNoFork(); - } - - if (!Config->writelog) return true; // Skip opening default log if -nolog + if (!Config->cmdline.writelog) return true; // Skip opening default log if -nolog - if (!*this->LogFileName) - { - if (Config->logpath.empty()) - { - Config->logpath = "logs/startup.log"; - } - - if (!Config->log_file) - Config->log_file = fopen(Config->logpath.c_str(),"a+"); - } - else - { - Config->log_file = fopen(this->LogFileName,"a+"); - } + if (Config->cmdline.startup_log.empty()) + Config->cmdline.startup_log = "logs/startup.log"; + FILE* startup = fopen(Config->cmdline.startup_log.c_str(), "a+"); - if (!Config->log_file) + if (!startup) { return false; } - FileWriter* fw = new FileWriter(Config->log_file); - FileLogStream *f = new FileLogStream((Config->forcedebug ? DEBUG : DEFAULT), fw); + FileWriter* fw = new FileWriter(startup); + FileLogStream *f = new FileLogStream((Config->cmdline.forcedebug ? DEBUG : DEFAULT), fw); this->Logs->AddLogType("*", f, true);