From 11f1f2126c3e1f1cb91f5d6e273eba2850ca61a8 Mon Sep 17 00:00:00 2001 From: aquanight Date: Fri, 15 Feb 2008 13:30:46 +0000 Subject: Make -nofork work properly with logging now. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8944 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/logger.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') 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 > LogStreams; std::map 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); -- cgit v1.2.3