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/operserv/news.cpp | |
parent | ff030c1eb7c3764f9add2a689479e84d616cabcb (diff) |
Make log system use newer format strings
Also allow log messages to be translatable
Diffstat (limited to 'modules/operserv/news.cpp')
-rw-r--r-- | modules/operserv/news.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/modules/operserv/news.cpp b/modules/operserv/news.cpp index e2119a2de..3a829f0c3 100644 --- a/modules/operserv/news.cpp +++ b/modules/operserv/news.cpp @@ -220,7 +220,8 @@ class NewsBase : public Command ni->SetWho(source.GetNick()); source.Reply(msgs[MSG_ADDED]); - Log(LOG_ADMIN, source, this) << "to add a news item"; + + logger.Command(LogType::ADMIN, source, _("{source} used {command} to add news item: {0}"), text); } void DoDel(CommandSource &source, const std::vector<Anope::string> ¶ms, NewsType ntype, const char **msgs) @@ -250,9 +251,13 @@ class NewsBase : public Command unsigned num = convertTo<unsigned>(text); if (num > 0 && num <= list.size()) { - list[num - 1]->Delete(); + NewsItem *item = list[num - 1]; source.Reply(msgs[MSG_DELETED], num); - Log(LOG_ADMIN, source, this) << "to delete a news item"; + + logger.Command(LogType::ADMIN, source, _("{source} used {command} to delete news item {0}"), item->GetText()); + + item->Delete(); + return; } } @@ -265,7 +270,8 @@ class NewsBase : public Command for (NewsItem *n : list) n->Delete(); source.Reply(msgs[MSG_DELETED_ALL]); - Log(LOG_ADMIN, source, this) << "to delete all news items"; + + logger.Command(LogType::ADMIN, source, _("{source} used {command} to delete all news items")); } } |