diff options
author | aquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-02-15 13:30:46 +0000 |
---|---|---|
committer | aquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-02-15 13:30:46 +0000 |
commit | 11f1f2126c3e1f1cb91f5d6e273eba2850ca61a8 (patch) | |
tree | 8bd6949852d761fe8976d4195af26653c3e702b8 /include/logger.h | |
parent | 7bd02d8a5dbac685d53a3f2aac9052c6ab5efa6e (diff) |
Make -nofork work properly with logging now.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8944 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/logger.h')
-rw-r--r-- | include/logger.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/logger.h b/include/logger.h index c9e9f8c0e..121d9ff25 100644 --- a/include/logger.h +++ b/include/logger.h @@ -86,6 +86,8 @@ class CoreExport LogStream : public classbase virtual ~LogStream() { } + void ChangeLevel(int lvl) { this->loglvl = lvl; } // For on-the-fly change of loglevel. + virtual void OnLog(int loglevel, const std::string &type, const std::string &msg) = 0; }; @@ -95,6 +97,7 @@ class CoreExport LogManager : public classbase { private: bool Logging; // true when logging, avoids recursion + LogStream* noforkstream; // LogStream for nofork. InspIRCd *ServerInstance; std::map<std::string, std::vector<LogStream *> > LogStreams; std::map<LogStream *, int> AllLogStreams; // holds all logstreams @@ -107,6 +110,8 @@ class CoreExport LogManager : public classbase Logging = false; } + void SetupNoFork(); + void AddLoggerRef(FileWriter* fw) { FileLogMap::iterator i = FileLogs.find(fw); @@ -134,7 +139,7 @@ class CoreExport LogManager : public classbase void OpenSingleFile(FILE* f, const std::string& type, int loglevel); void OpenFileLogs(); void CloseLogs(); - bool AddLogType(const std::string &type, LogStream *l); + bool AddLogType(const std::string &type, LogStream *l, bool autoclose); void DelLogStream(LogStream* l); bool DelLogType(const std::string &type, LogStream *l); void Log(const std::string &type, int loglevel, const std::string &msg); |