summaryrefslogtreecommitdiff
path: root/modules/chanserv/main
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2017-01-23 12:35:14 -0500
committerAdam <Adam@anope.org>2017-01-23 12:35:14 -0500
commit16ca76c2e7ab287e480185fbb03a0bb438351eda (patch)
treedfb25534afa2352b65b2ee707086cb5eecc96fbb /modules/chanserv/main
parentff030c1eb7c3764f9add2a689479e84d616cabcb (diff)
Make log system use newer format strings
Also allow log messages to be translatable
Diffstat (limited to 'modules/chanserv/main')
-rw-r--r--modules/chanserv/main/channel.cpp10
-rw-r--r--modules/chanserv/main/chanserv.cpp20
2 files changed, 19 insertions, 11 deletions
diff --git a/modules/chanserv/main/channel.cpp b/modules/chanserv/main/channel.cpp
index a35c80901..d10abbc0d 100644
--- a/modules/chanserv/main/channel.cpp
+++ b/modules/chanserv/main/channel.cpp
@@ -30,7 +30,7 @@ void ChannelImpl::Delete()
{
EventManager::Get()->Dispatch(&Event::DelChan::OnDelChan, this);
- Log(LOG_DEBUG) << "Deleting channel " << this->GetName();
+ Anope::Logger.Debug("Deleting channel {0}", this->GetName());
if (this->c)
{
@@ -361,7 +361,7 @@ ChanServ::AccessGroup ChannelImpl::AccessFor(const User *u, bool updateLastUsed)
return group;
NickServ::Account *nc = u->Account();
- if (nc == NULL && !nc->IsSecure() && u->IsRecognized())
+ if (nc == NULL && !this->IsSecure() && u->IsRecognized())
{
NickServ::Nick *na = NickServ::FindNick(u->nick);
if (na != NULL)
@@ -480,7 +480,7 @@ int16_t ChannelImpl::GetLevel(const Anope::string &priv)
ChanServ::Privilege *p = ChanServ::service ? ChanServ::service->FindPrivilege(priv) : nullptr;
if (!p)
{
- Log(LOG_DEBUG) << "Unknown privilege " + priv;
+ Anope::Logger.Debug("Unknown privilege {0}", priv);
return ChanServ::ACCESS_INVALID;
}
@@ -499,7 +499,7 @@ void ChannelImpl::SetLevel(const Anope::string &priv, int16_t level)
ChanServ::Privilege *p = ChanServ::service ? ChanServ::service->FindPrivilege(priv) : nullptr;
if (!p)
{
- Log(LOG_DEBUG) << "Unknown privilege " + priv;
+ Anope::Logger.Debug("Unknown privilege {0}", priv);
return;
}
@@ -538,7 +538,7 @@ Anope::string ChannelImpl::GetIdealBan(User *u)
else
return "*!" + u->GetVIdent() + "@" + u->GetDisplayedHost();
case 3:
- return "*!" + u->Mask();
+ return "*!" + u->WildMask();
case 2:
default:
return "*!*@" + u->GetDisplayedHost();
diff --git a/modules/chanserv/main/chanserv.cpp b/modules/chanserv/main/chanserv.cpp
index 492f64459..62d1e81ba 100644
--- a/modules/chanserv/main/chanserv.cpp
+++ b/modules/chanserv/main/chanserv.cpp
@@ -309,7 +309,9 @@ class ChanServCore : public Module
if (newowner)
{
- ::Log(LOG_NORMAL, "chanserv/drop", ChanServ) << "Transferring foundership of " << ci->GetName() << " from deleted account " << nc->GetDisplay() << " to " << newowner->GetDisplay();
+ ChanServ->logger.Category("chanserv/drop").Log(_("Transferring foundership of {0} from deleted account {1} to {2}"),
+ ci->GetName(), nc->GetDisplay(), newowner->GetDisplay());
+
ci->SetFounder(newowner);
// Can't be both founder and successor
@@ -318,7 +320,8 @@ class ChanServCore : public Module
}
else
{
- ::Log(LOG_NORMAL, "chanserv/drop", ChanServ) << "Deleting channel " << ci->GetName() << " owned by deleted account " << nc->GetDisplay();
+ ChanServ->logger.Category("chanserv/drop").Log(_("Deleting channel {0} owned by deleted account {1}"),
+ ci->GetName(), nc->GetDisplay());
ci->Delete();
continue;
@@ -408,10 +411,13 @@ class ChanServCore : public Module
}
}
- void OnLog(::Log *l) override
+ void OnLog(Logger *l) override
{
- if (l->type == LOG_CHANNEL)
+#warning ""
+#if 0
+ if (l->type == LogType::CHANNEL)
l->bi = ChanServ;
+#endif
}
void OnExpireTick() override
@@ -442,7 +448,9 @@ class ChanServCore : public Module
if (expire)
{
- ::Log(LOG_NORMAL, "chanserv/expire", ChanServ) << "Expiring channel " << ci->GetName() << " (founder: " << (ci->GetFounder() ? ci->GetFounder()->GetDisplay() : "(none)") << ")";
+ ChanServ->logger.Category("chanserv/expire").Log(_("Expiring channel {0} (founder: {1})"),
+ ci->GetName(), ci->GetFounder() ? ci->GetFounder()->GetDisplay() : "(none)");
+
EventManager::Get()->Dispatch(&ChanServ::Event::ChanExpire::OnChanExpire, ci);
ci->Delete();
}
@@ -511,7 +519,7 @@ class ChanServCore : public Module
{
if (always_lower && c->ci && c->creation_time > c->ci->GetTimeRegistered())
{
- ::Log(LOG_DEBUG) << "Changing TS of " << c->name << " from " << c->creation_time << " to " << c->ci->GetTimeRegistered();
+ logger.Debug("Changing TS of {0} from {1} to {2}", c->name, c->creation_time, c->ci->GetTimeRegistered());
c->creation_time = c->ci->GetTimeRegistered();
IRCD->Send<messages::MessageChannel>(c);
c->Reset();