diff options
author | Adam <Adam@anope.org> | 2017-01-23 12:35:14 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2017-01-23 12:35:14 -0500 |
commit | 16ca76c2e7ab287e480185fbb03a0bb438351eda (patch) | |
tree | dfb25534afa2352b65b2ee707086cb5eecc96fbb /modules/chanserv/suspend.cpp | |
parent | ff030c1eb7c3764f9add2a689479e84d616cabcb (diff) |
Make log system use newer format strings
Also allow log messages to be translatable
Diffstat (limited to 'modules/chanserv/suspend.cpp')
-rw-r--r-- | modules/chanserv/suspend.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/chanserv/suspend.cpp b/modules/chanserv/suspend.cpp index 7895aaa02..c686ffdb7 100644 --- a/modules/chanserv/suspend.cpp +++ b/modules/chanserv/suspend.cpp @@ -189,7 +189,9 @@ class CommandCSSuspend : public Command ci->c->Kick(NULL, users[i], !reason.empty() ? reason : Language::Translate(users[i], _("This channel has been suspended."))); } - Log(LOG_ADMIN, source, this, ci) << "(" << (!reason.empty() ? reason : "No reason") << "), expires on " << (expiry_secs ? Anope::strftime(Anope::CurTime + expiry_secs) : "never"); + logger.Command(LogType::ADMIN, source, ci, _("{source} used {command} on {channel} ({0}), expires on {1}"), + !reason.empty() ? reason : "No reason", expiry_secs ? Anope::strftime(Anope::CurTime + expiry_secs) : "never"); + source.Reply(_("Channel \002{0}\002 is now suspended."), ci->GetName()); EventManager::Get()->Dispatch(&Event::ChanSuspend::OnChanSuspend, ci); @@ -234,11 +236,12 @@ class CommandCSUnSuspend : public Command return; } - Log(LOG_ADMIN, source, this, ci) << "which was suspended by " << si->GetBy() << " for: " << (!si->GetReason().empty() ? si->GetReason() : "No reason"); + logger.Command(LogType::ADMIN, source, ci, _("{source} used {command} on {channel} which was suspended by {0} for: {1}"), + si->GetBy(), !si->GetReason().empty() ? si->GetReason() : "No reason"); si->Delete(); - source.Reply(_("Channel \002%s\002 is now released."), ci->GetName().c_str()); + source.Reply(_("Channel \002{0}\002 is now released."), ci->GetName()); EventManager::Get()->Dispatch(&Event::ChanUnsuspend::OnChanUnsuspend, ci); } @@ -320,7 +323,7 @@ class CSSuspend : public Module ci->SetLastUsed(Anope::CurTime); si->Delete(); - Log(this) << "Expiring suspend for " << ci->GetName(); + logger.Channel(ci).Log(_("Expiring suspend for {0}"), ci->GetName()); } } |