diff options
author | aquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-02-15 13:30:46 +0000 |
---|---|---|
committer | aquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-02-15 13:30:46 +0000 |
commit | 11f1f2126c3e1f1cb91f5d6e273eba2850ca61a8 (patch) | |
tree | 8bd6949852d761fe8976d4195af26653c3e702b8 /src/helperfuncs.cpp | |
parent | 7bd02d8a5dbac685d53a3f2aac9052c6ab5efa6e (diff) |
Make -nofork work properly with logging now.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8944 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r-- | src/helperfuncs.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
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; } |