From 11f1f2126c3e1f1cb91f5d6e273eba2850ca61a8 Mon Sep 17 00:00:00 2001 From: aquanight Date: Fri, 15 Feb 2008 13:30:46 +0000 Subject: Make -nofork work properly with logging now. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8944 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/helperfuncs.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/helperfuncs.cpp') diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 8e9f4dfd5..8cb62e72f 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -303,6 +303,12 @@ bool InspIRCd::IsSID(const std::string &str) /* open the proper logfile */ bool InspIRCd::OpenLog(char**, int) { + /* This function only happens at startup now (log reopening is done at OnReadConfig stage now instead of rehash) */ + if (Config->nofork) + { + this->Logs->SetupNoFork(); + } + if (!Config->writelog) return true; // Skip opening default log if -nolog Config->MyDir = Config->GetFullProgDir(); if (!*this->LogFileName) @@ -325,9 +331,10 @@ bool InspIRCd::OpenLog(char**, int) } FileWriter* fw = new FileWriter(this, Config->log_file); - FileLogStream *f = new FileLogStream(this, Config->LogLevel, fw); + FileLogStream *f = new FileLogStream(this, (Config->forcedebug ? DEBUG : Config->LogLevel), fw); + + this->Logs->AddLogType("*", f, true); - this->Logs->AddLogType("*", f); return true; } -- cgit v1.2.3