]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/logger.h
Remove InspIRCd* parameters and fields
[user/henk/code/inspircd.git] / include / logger.h
index 7ecf954f410733783a7f6214d2e8c3c41072673c..37020a4ffb04404cdf09792ea46812545997afd7 100644 (file)
 class CoreExport FileWriter : public EventHandler
 {
  protected:
-       /** The creator/owner of this object
-        */
-       InspIRCd* ServerInstance;
-
        /** The log file (fd is inside this somewhere,
         * we get it out with fileno())
         */
@@ -45,7 +41,7 @@ class CoreExport FileWriter : public EventHandler
  public:
        /** The constructor takes an already opened logfile.
         */
-       FileWriter(InspIRCd* Instance, FILE* logfile);
+       FileWriter(FILE* logfile);
 
        /** Handle pending write events.
         * This will flush any waiting data to disk.
@@ -69,7 +65,6 @@ class CoreExport FileWriter : public EventHandler
        virtual void Close();
 
        /** Close the log file and cancel any events.
-        * (indirectly call Close()
         */
        virtual ~FileWriter();
 };
@@ -97,10 +92,9 @@ class CoreExport FileWriter : public EventHandler
 class CoreExport LogStream : public classbase
 {
  protected:
-       InspIRCd *ServerInstance;
        int loglvl;
  public:
-       LogStream(InspIRCd *Instance, int loglevel) : ServerInstance(Instance), loglvl(loglevel)
+       LogStream(int loglevel) : loglvl(loglevel)
        {
        }
 
@@ -134,8 +128,6 @@ class CoreExport LogManager : public classbase
         */
        LogStream* noforkstream;
 
-       InspIRCd *ServerInstance;
-
        /** Map of active log types and what LogStreams will receive them.
         */
        std::map<std::string, std::vector<LogStream *> > LogStreams;
@@ -155,13 +147,18 @@ class CoreExport LogManager : public classbase
 
  public:
 
-       LogManager(InspIRCd *Instance)
+       LogManager()
        {
                noforkstream = NULL;
-               ServerInstance = Instance;
                Logging = false;
        }
 
+       ~LogManager()
+       {
+               if (noforkstream)
+                       delete noforkstream;
+       }
+
        /** Sets up the logstream for -nofork. Called by InspIRCd::OpenLog() and LogManager::OpenFileLogs().
         * First time called it creates the nofork stream and stores it in noforkstream. Each call thereafter just readds it to GlobalLogStreams
         * and updates the loglevel.