]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/filelogger.h
Correctly rewrite bans in 1.2 also, and make zline on nicks actually work.
[user/henk/code/inspircd.git] / include / filelogger.h
index ab92e8cdee6556634a36aa75e095d890b14479cb..a2d63a0d997c6991fc134228e8adc19e8ed5e1d7 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
 #ifndef __LOG_H__
 #define __LOG_H__
 
-#include <time.h>
-#include <string>
-#include <sstream>
-#include "socketengine.h"
-
-
 /** Debug levels for use with InspIRCd::Log()
  *  */
 enum DebugLevel
@@ -52,7 +46,7 @@ class CoreExport FileLogger : public EventHandler
  protected:
        /** The creator/owner of this object
         */
-    InspIRCd* ServerInstance;
+       InspIRCd* ServerInstance;
        /** The log file (fd is inside this somewhere,
         * we get it out with fileno())
         */
@@ -94,5 +88,22 @@ class CoreExport FileLogger : public EventHandler
        virtual ~FileLogger();
 };
 
+class CoreExport FileLogStream : public LogStream
+{
+ private:
+       FileLogger *f;
+ public:
+       FileLogStream(InspIRCd *Instance, int loglevel, FILE *f) : LogStream(Instance, loglevel)
+       {
+               this->f = new FileLogger(Instance, f);
+       }
+
+       ~FileLogStream()
+       {
+               delete this->f;
+       }
+
+       virtual void OnLog(int loglevel, const std::string &type, const std::string &msg);
+};
 
 #endif