diff options
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() |