summaryrefslogtreecommitdiff
path: root/src/helperfuncs.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-21 23:46:24 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-21 23:46:24 +0000
commitdcbb0ae938711cd49df73dc2ff6cd6289aeefb44 (patch)
tree82405b49cdba5a0e0f8819df367c75a5c24e455e /src/helperfuncs.cpp
parentd8f98565a8617658f610bc94a5d87266930beee4 (diff)
Move command-line items to CommandLineConf
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11949 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r--src/helperfuncs.cpp31
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);