]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/helperfuncs.cpp
Made SANICK not collide the user (theres no need to in the new 1.1 now we have return...
[user/henk/code/inspircd.git] / src / helperfuncs.cpp
index cc4b8355fc5ac4992e9ac7b448a433b39ea6b41c..4afe7afeba1fcdfcdd4774666c3261609b3d795a 100644 (file)
  */
 
 #include <stdarg.h>
-#include "inspircd_config.h"
 #include "configreader.h"
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/errno.h>
-#include <signal.h>
-#include <time.h>
-#include <string>
-#include <sstream>
-#ifdef HAS_EXECINFO
-#include <execinfo.h>
-#endif
-#include "connection.h"
 #include "users.h"
-#include "ctables.h"
-#include "globals.h"
 #include "modules.h"
-#include "dynamic.h"
 #include "wildcard.h"
 #include "mode.h"
 #include "xline.h"
-#include "commands.h"
-#include "inspstring.h"
-
-#include "hashcomp.h"
-#include "typedefs.h"
 #include "inspircd.h"
 
 static char TIMESTR[26];
@@ -83,8 +63,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 +426,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 +438,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()