]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/helperfuncs.cpp
auto-set +s when +n is set (as +n requires +s) - allow +n to be 'set twice' allowing...
[user/henk/code/inspircd.git] / src / helperfuncs.cpp
index 51246199a6a8768a2f7d88c0e354ded104f2e2cd..07f9228d479323b39726572d2f529b387d605ea6 100644 (file)
@@ -38,7 +38,7 @@
 #include "xline.h"
 #include "commands.h"
 #include "inspstring.h"
-#include "helperfuncs.h"
+
 #include "hashcomp.h"
 #include "typedefs.h"
 #include "inspircd.h"
@@ -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()