]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/logger.h
Correctly rewrite bans in 1.2 also, and make zline on nicks actually work.
[user/henk/code/inspircd.git] / include / logger.h
index d32c3d1844e788b4cd9cd0e497ccbb1c12cc1fe4..8f030b53b69221e19552ea4d63dcc98e896d2b8e 100644 (file)
@@ -18,20 +18,20 @@ class CoreExport LogStream : public classbase
 {
  protected:
        InspIRCd *ServerInstance;
-       std::string type;
+       int loglvl;
  public:
-       LogStream(InspIRCd *Instance, const std::string &type)
+       LogStream(InspIRCd *Instance, int loglevel) : loglvl(loglevel)
        {
                this->ServerInstance = Instance;
-               this->type = type;
        }
 
-       virtual void OnLog(int loglevel, const std::string &msg) { }
+       virtual void OnLog(int loglevel, const std::string &type, const std::string &msg) { }
 };
 
 class CoreExport LogManager : public classbase
 {
  private:
+       bool Logging; // true when logging, avoids recursion
        InspIRCd *ServerInstance;
        std::map<std::string, std::vector<LogStream *> > LogStreams;
        std::vector<LogStream *> GlobalLogStreams; //holds all logstreams with a type of *
@@ -39,11 +39,14 @@ class CoreExport LogManager : public classbase
        LogManager(InspIRCd *Instance)
        {
                ServerInstance = Instance;
+               Logging = false;
        }
 
+       void CloseLogs();
        bool AddLogType(const std::string &type, LogStream *l);
        bool DelLogType(const std::string &type, LogStream *l);
        void Log(const std::string &type, int loglevel, const std::string &msg);
+       void Log(const std::string &type, int loglevel, const char *fmt, ...);
 };
 
 #endif