diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-18 22:01:26 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-18 22:01:26 +0000 |
commit | 5adcab2223c1f64550f24c2b1d49d1299ceb69d5 (patch) | |
tree | 8614a97923ebf4f1ff2fbc3df4109928a3fe1e81 /src/helperfuncs.cpp | |
parent | 365fd7e1e903e99d7e3399487d1cf9204ebe64fa (diff) |
NONBLOCKING LOGGER!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4971 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r-- | src/helperfuncs.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index cc4b8355f..e4be94ec0 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -83,8 +83,8 @@ void InspIRCd::Log(int level, const std::string &text) if (Config->log_file && Config->writelog) { - fprintf(Config->log_file,"%s %s\n",TIMESTR,text.c_str()); - fflush(Config->log_file); + std::string out = std::string(TIMESTR) + text.c_str() + "\n"; + this->Logger->WriteLogLine(out); } if (Config->nofork) @@ -446,6 +446,8 @@ void InspIRCd::OpenLog(char** argv, int argc) printf("ERROR: Could not write to logfile %s, bailing!\n\n",Config->logpath.c_str()); Exit(ERROR); } + + this->Logger = new FileLogger(this, Config->log_file); return; } @@ -456,6 +458,8 @@ void InspIRCd::OpenLog(char** argv, int argc) printf("ERROR: Could not write to logfile %s, bailing!\n\n",Config->logpath.c_str()); Exit(ERROR); } + + this->Logger = new FileLogger(this, Config->log_file); } void InspIRCd::CheckRoot() |