diff options
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r-- | src/helperfuncs.cpp | 31 |
1 files changed, 7 insertions, 24 deletions
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); |