From dcbb0ae938711cd49df73dc2ff6cd6289aeefb44 Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 21 Oct 2009 23:46:24 +0000 Subject: Move command-line items to CommandLineConf git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11949 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/helperfuncs.cpp | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) (limited to 'src/helperfuncs.cpp') 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); -- cgit v1.2.3