summaryrefslogtreecommitdiff
path: root/modules/hostserv
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/hostserv
parentff030c1eb7c3764f9add2a689479e84d616cabcb (diff)
Make log system use newer format strings
Also allow log messages to be translatable
Diffstat (limited to 'modules/hostserv')
-rw-r--r--modules/hostserv/add.cpp2
-rw-r--r--modules/hostserv/del.cpp5
-rw-r--r--modules/hostserv/off.cpp2
-rw-r--r--modules/hostserv/on.cpp2
-rw-r--r--modules/hostserv/request.cpp8
-rw-r--r--modules/hostserv/set.cpp2
6 files changed, 13 insertions, 8 deletions
diff --git a/modules/hostserv/add.cpp b/modules/hostserv/add.cpp
index f9388c975..3448dbc41 100644
--- a/modules/hostserv/add.cpp
+++ b/modules/hostserv/add.cpp
@@ -101,7 +101,7 @@ class CommandHSAdd : public Command
}
Anope::string mask = (!user.empty() ? user + "@" : "") + host;
- Log(LOG_ADMIN, source, this) << "to add the vhost " << mask << " to " << na->GetAccount()->GetDisplay();
+ logger.Command(LogType::ADMIN, source, _("{source} used {command} to add the vhost {0} to {1}"), mask, na->GetAccount()->GetDisplay());
HostServ::VHost *vhost = Serialize::New<HostServ::VHost *>();
if (vhost == nullptr)
diff --git a/modules/hostserv/del.cpp b/modules/hostserv/del.cpp
index 4d754ac1b..a72c61c9a 100644
--- a/modules/hostserv/del.cpp
+++ b/modules/hostserv/del.cpp
@@ -54,7 +54,7 @@ class CommandHSDel : public Command
return;
}
- Log(LOG_ADMIN, source, this) << "on " << na->GetAccount()->GetDisplay() << " to remove vhost " << vhost->Mask();
+ logger.Command(LogType::ADMIN, source, _("{source} used {command} on {0} to remove vhost {1}"), na->GetAccount()->GetDisplay(), vhost->Mask());
source.Reply(_("Vhost \002{0}\002 for \002{1}\002 has been removed."), vhost->Mask(), na->GetAccount()->GetDisplay());
vhost->Delete();
return;
@@ -67,7 +67,8 @@ class CommandHSDel : public Command
return;
}
- Log(LOG_ADMIN, source, this) << "on " << na->GetAccount()->GetDisplay();
+ logger.Command(LogType::ADMIN, source, _("{source} used {command} on {0}"), na->GetAccount()->GetDisplay());
+
#warning "send account"
EventManager::Get()->Dispatch(&Event::DeleteVhost::OnDeleteVhost, na);
diff --git a/modules/hostserv/off.cpp b/modules/hostserv/off.cpp
index e1af7def4..861fd00b8 100644
--- a/modules/hostserv/off.cpp
+++ b/modules/hostserv/off.cpp
@@ -43,7 +43,7 @@ class CommandHSOff : public Command
// XXX vident?
u->vhost.clear();
IRCD->Send<messages::VhostDel>(u);
- Log(LOG_COMMAND, source, this) << "to disable their vhost";
+ logger.Command(LogType::ADMIN, source, _("{source} used {command} to disable their vhost"));
source.Reply(_("Your vhost was removed and the normal cloaking restored."));
}
diff --git a/modules/hostserv/on.cpp b/modules/hostserv/on.cpp
index 3041f65a5..556b2f567 100644
--- a/modules/hostserv/on.cpp
+++ b/modules/hostserv/on.cpp
@@ -59,7 +59,7 @@ class CommandHSOn : public Command
source.Reply(_("Your vhost of \002{0}\002 is now activated."), vhost->Mask());
- Log(LOG_COMMAND, source, this) << "to enable their vhost of " << vhost->Mask();
+ logger.Command(LogType::ADMIN, source, _("{source} used {command} to enable their vhost of {0}"), vhost->Mask());
IRCD->Send<messages::VhostSet>(u, vhost->GetIdent(), vhost->GetHost());
u->vhost = vhost->GetHost();
if (IRCD->CanSetVIdent && !vhost->GetIdent().empty())
diff --git a/modules/hostserv/request.cpp b/modules/hostserv/request.cpp
index 9508a9abc..bef1f1548 100644
--- a/modules/hostserv/request.cpp
+++ b/modules/hostserv/request.cpp
@@ -232,7 +232,7 @@ class CommandHSRequest : public Command
source.Reply(_("Your vhost has been requested."));
this->SendMemos(source, user, host);
- Log(LOG_COMMAND, source, this) << "to request new vhost " << (!user.empty() ? user + "@" : "") << host;
+ logger.Command(LogType::COMMAND, source, _("{source} used {command} to request new vhost {0}"), (!user.empty() ? user + "@" : "") + host);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
@@ -303,7 +303,8 @@ class CommandHSActivate : public Command
memoserv->Send(source.service->nick, na->GetNick(), _("[auto memo] Your requested vHost has been approved."), true);
source.Reply(_("Vhost for \002{0}\002 has been activated."), na->GetNick());
- Log(LOG_COMMAND, source, this) << "for " << na->GetNick() << " for vhost " << (!req->GetIdent().empty() ? req->GetIdent() + "@" : "") << req->GetHost();
+ logger.Command(LogType::COMMAND, source, _("{source} used {command} for {0} for vhost {1}"),
+ na->GetNick(), (!req->GetIdent().empty() ? req->GetIdent() + "@" : "") + req->GetHost());
req->Delete();
}
@@ -367,7 +368,8 @@ class CommandHSReject : public Command
}
source.Reply(_("Vhost for \002{0}\002 has been rejected."), na->GetNick());
- Log(LOG_COMMAND, source, this) << "to reject vhost for " << nick << " (" << (!reason.empty() ? reason : "no reason") << ")";
+ logger.Command(LogType::COMMAND, source, _("{source} used {command} to reject vhost for {0} ({1})"),
+ na->GetNick(), !reason.empty() ? reason : "no reason");
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
diff --git a/modules/hostserv/set.cpp b/modules/hostserv/set.cpp
index f66c42d8a..8162fa80d 100644
--- a/modules/hostserv/set.cpp
+++ b/modules/hostserv/set.cpp
@@ -113,6 +113,8 @@ class CommandHSSetDefault : public Command
vhost->SetDefault(true);
source.Reply(_("Your default vhost is now \002{0}\002."), vhost->Mask());
+
+ logger.Command(LogType::COMMAND, source, _("{source} used {command} set their default vhost to {0}"), vhost->Mask());
}
bool OnHelp(CommandSource &source, const Anope::string &) override