diff options
author | aquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-02-10 14:20:58 +0000 |
---|---|---|
committer | aquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-02-10 14:20:58 +0000 |
commit | f63580a4eaa8d079200065dffa4d6a33b5577427 (patch) | |
tree | ec0d1a30442d29f5d9cc568817b0f7266bf4e514 /src/modules | |
parent | b1312399e42cb4b34e86f6c7075abca64665cdd3 (diff) |
Per-logstream loglevels.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8871 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_chanlog.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/modules/m_chanlog.cpp b/src/modules/m_chanlog.cpp index a0d3da4dc..f1553ccea 100644 --- a/src/modules/m_chanlog.cpp +++ b/src/modules/m_chanlog.cpp @@ -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); |