diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-02-09 21:00:07 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-02-09 21:00:07 +0000 |
commit | 1df212127427f88b502a5f1030fd2e0a31bd499e (patch) | |
tree | e4b4aefc0e4c4950107abd578cc74dc13450ee1b /include | |
parent | 67976608ff1afff71e46a72b3d0c2dca800292e1 (diff) |
Fix a bug in new logging API (global logstreams weren't notified of events if a specific logstream had an event claimed, don't store type in logstreams (pass it to OnLog instead), and add an example of what the new logging API can do: m_chanlog - logs to #services at the moment.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8865 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r-- | include/filelogger.h | 4 | ||||
-rw-r--r-- | include/logger.h | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/include/filelogger.h b/include/filelogger.h index d236fe3de..333a0236e 100644 --- a/include/filelogger.h +++ b/include/filelogger.h @@ -93,7 +93,7 @@ class CoreExport FileLogStream : public LogStream private: FileLogger *f; public: - FileLogStream(InspIRCd *Instance, FILE *f, const std::string &type) : LogStream(Instance, type) + FileLogStream(InspIRCd *Instance, FILE *f) : LogStream(Instance) { this->f = new FileLogger(Instance, f); } @@ -103,7 +103,7 @@ class CoreExport FileLogStream : public LogStream delete this->f; } - virtual void OnLog(int loglevel, const std::string &msg); + virtual void OnLog(int loglevel, const std::string &type, const std::string &msg); }; #endif diff --git a/include/logger.h b/include/logger.h index 70407422f..492f6c20a 100644 --- a/include/logger.h +++ b/include/logger.h @@ -18,20 +18,19 @@ class CoreExport LogStream : public classbase { protected: InspIRCd *ServerInstance; - std::string type; public: - LogStream(InspIRCd *Instance, const std::string &type) + LogStream(InspIRCd *Instance) { 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,6 +38,7 @@ class CoreExport LogManager : public classbase LogManager(InspIRCd *Instance) { ServerInstance = Instance; + Logging = false; } void CloseLogs(); |