]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chanlog.cpp
Add comments
[user/henk/code/inspircd.git] / src / modules / m_chanlog.cpp
index a0d3da4dcd8fbf2e7c0737547f7314b331f078ae..f1553ccea3c01a424989ce8ac9d251bc48666b27 100644 (file)
@@ -17,16 +17,18 @@ class ChannelLogStream : public LogStream
 {
  private:
        std::string channel;
-       
+
  public:
-       ChannelLogStream(InspIRCd *Instance, const std::string &chan) : LogStream(Instance), channel(chan)
+       ChannelLogStream(InspIRCd *Instance, int loglevel, const std::string &chan) : LogStream(Instance, loglevel), channel(chan)
        {
        }
-                                                               
+
        virtual void OnLog(int loglevel, const std::string &type, const std::string &msg)
        {
                Channel *c = ServerInstance->FindChan(channel);
-               
+
+               if (loglevel < this->loglvl) return;
+
                if (c)
                {
                        // So this won't work remotely. Oh well.
@@ -45,15 +47,15 @@ class ModuleChanLog : public Module
  public:
        ModuleChanLog(InspIRCd* Me) : Module(Me)
        {
-               l = new ChannelLogStream(Me, "#services");
+               l = new ChannelLogStream(Me, ServerInstance->Config->LogLevel, "#services");
                Me->Logs->AddLogType("*", l);
        }
-       
+
        virtual ~ModuleChanLog()
        {
                delete l;
        }
-       
+
        virtual Version GetVersion()
        {
                return Version(1,1,0,1,VF_VENDOR,API_VERSION);