summaryrefslogtreecommitdiff
path: root/modules/operserv/set.cpp
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/operserv/set.cpp
parentff030c1eb7c3764f9add2a689479e84d616cabcb (diff)
Make log system use newer format strings
Also allow log messages to be translatable
Diffstat (limited to 'modules/operserv/set.cpp')
-rw-r--r--modules/operserv/set.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/modules/operserv/set.cpp b/modules/operserv/set.cpp
index e23efb849..f8a63dca8 100644
--- a/modules/operserv/set.cpp
+++ b/modules/operserv/set.cpp
@@ -24,7 +24,7 @@ class CommandOSSet : public Command
private:
void DoList(CommandSource &source)
{
- Log(LOG_ADMIN, source, this) << "LIST";
+ logger.Command(LogType::ADMIN, source, _("{source} used {command} LIST"));
const char *str;
@@ -51,13 +51,13 @@ class CommandOSSet : public Command
if (setting.equals_ci("ON"))
{
Anope::ReadOnly = true;
- Log(LOG_ADMIN, source, this) << "READONLY ON";
+ logger.Command(LogType::ADMIN, source, _("{source} used {command} READONLY ON"));
source.Reply(_("Services are now in \002read-only\002 mode."));
}
else if (setting.equals_ci("OFF"))
{
Anope::ReadOnly = false;
- Log(LOG_ADMIN, source, this) << "READONLY OFF";
+ logger.Command(LogType::ADMIN, source, _("{source} used {command} READONLY OFF"));
source.Reply(_("Services are now in \002read-write\002 mode."));
}
else
@@ -95,13 +95,15 @@ class CommandOSSet : public Command
{
source.GetUser()->super_admin = true;
source.Reply(_("You are now a super admin."));
- Log(LOG_ADMIN, source, this) << "SUPERADMIN ON";
+ logger.Command(LogType::ADMIN, source, _("{source} used {command} SUPERADMIN ON"),
+ source.GetSource(), source.GetCommand());
}
else if (setting.equals_ci("OFF"))
{
source.GetUser()->super_admin = false;
source.Reply(_("You are no longer a super admin."));
- Log(LOG_ADMIN, source, this) << "SUPERADMIN OFF";
+ logger.Command(LogType::ADMIN, source, _("{source} used {command} SUPERADMIN OFF"),
+ source.GetSource(), source.GetCommand());
}
else
{
@@ -122,12 +124,13 @@ class CommandOSSet : public Command
if (setting.equals_ci("ON"))
{
Anope::Debug = 1;
- Log(LOG_ADMIN, source, this) << "DEBUG ON";
+ logger.Command(LogType::ADMIN, source, _("{source} used {command} DEBUG ON"),
+ source.GetSource(), source.GetCommand());
source.Reply(_("Services are now in \002debug\002 mode."));
}
else if (setting.equals_ci("OFF") || setting == "0")
{
- Log(LOG_ADMIN, source, this) << "DEBUG OFF";
+ logger.Command(LogType::ADMIN, source, _("{source} used {command} DEBUG OFF"));
Anope::Debug = 0;
source.Reply(_("Services are now in \002non-debug\002 mode."));
}
@@ -136,7 +139,7 @@ class CommandOSSet : public Command
try
{
Anope::Debug = convertTo<int>(setting);
- Log(LOG_ADMIN, source, this) << "DEBUG " << Anope::Debug;
+ logger.Command(LogType::ADMIN, source, _("{source} used {command} DEBUG {0}"), Anope::Debug);
source.Reply(_("Services are now in \002debug\002 mode (level %d)."), Anope::Debug);
return;
}
@@ -159,13 +162,13 @@ class CommandOSSet : public Command
if (setting.equals_ci("ON"))
{
Anope::NoExpire = true;
- Log(LOG_ADMIN, source, this) << "NOEXPIRE ON";
+ logger.Command(LogType::ADMIN, source, _("{source} used {command} NOEXPIRE ON"), Anope::Debug);
source.Reply(_("Services are now in \002no expire\002 mode."));
}
else if (setting.equals_ci("OFF"))
{
Anope::NoExpire = false;
- Log(LOG_ADMIN, source, this) << "NOEXPIRE OFF";
+ logger.Command(LogType::ADMIN, source, _("{source} used {command} NOEXPIRE OFF"), Anope::Debug);
source.Reply(_("Services are now in \002expire\002 mode."));
}
else