1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 19:14:47 +02:00

Add logging to several operserv commands

This commit is contained in:
Adam
2013-08-25 00:14:17 -04:00
parent 446b3a910d
commit 00a19529c3
7 changed files with 30 additions and 0 deletions
+10
View File
@@ -27,6 +27,11 @@ class CommandOSChanList : public Command
std::set<Anope::string> modes;
User *u2;
if (!pattern.empty())
Log(LOG_ADMIN, source, this) << "for " << pattern;
else
Log(LOG_ADMIN, source, this);
if (!opt.empty() && opt.equals_ci("SECRET"))
{
modes.insert("SECRET");
@@ -129,6 +134,11 @@ class CommandOSUserList : public Command
Channel *c;
std::set<Anope::string> modes;
if (!pattern.empty())
Log(LOG_ADMIN, source, this) << "for " << pattern;
else
Log(LOG_ADMIN, source, this);
if (!opt.empty() && opt.equals_ci("INVISIBLE"))
modes.insert("INVIS");
+7
View File
@@ -24,6 +24,8 @@ class CommandOSModInfo : public Command
{
const Anope::string &file = params[0];
Log(LOG_ADMIN, source, this) << "on " << file;
Module *m = ModuleManager::FindModule(file);
if (m)
{
@@ -81,6 +83,11 @@ class CommandOSModList : public Command
{
const Anope::string &param = !params.empty() ? params[0] : "";
if (!param.empty())
Log(LOG_ADMIN, source, this) << "for " << param;
else
Log(LOG_ADMIN, source, this);
bool third = false, extra = false, vendor = false, database = false, encryption = false, pseudoclient = false, protocol = false;
if (param.equals_ci("all"))
+2
View File
@@ -23,6 +23,8 @@ class CommandOSReload : public Command
{
try
{
Log(LOG_ADMIN, source, this);
Configuration::Conf *new_config = new Configuration::Conf();
delete Config;
Config = new_config;
+5
View File
@@ -244,6 +244,8 @@ class CommandOSSession : public Command
{
const Anope::string &cmd = params[0];
Log(LOG_ADMIN, source, this) << cmd << " " << params[1];
if (!session_limit)
source.Reply(_("Session limiting is disabled."));
else if (cmd.equals_ci("LIST"))
@@ -365,6 +367,7 @@ class CommandOSException : public Command
delete exception;
else
{
Log(LOG_ADMIN, source, this) << "to set the session limit for " << mask << " to " << limit;
session_service->AddException(exception);
source.Reply(_("Session limit for \002%s\002 set to \002%d\002."), mask.c_str(), limit);
if (Anope::ReadOnly)
@@ -396,6 +399,7 @@ class CommandOSException : public Command
for (; i < end; ++i)
if (mask.equals_ci(session_service->GetExceptions()[i]->mask))
{
Log(LOG_ADMIN, source, this) << "to remove session limit exception for " << mask;
ExceptionDelCallback::DoDel(source, i);
source.Reply(_("\002%s\002 deleted from session-limit exception list."), mask.c_str());
break;
@@ -436,6 +440,7 @@ class CommandOSException : public Command
session_service->GetExceptions()[n1] = session_service->GetExceptions()[n2];
session_service->GetExceptions()[n2] = temp;
Log(LOG_ADMIN, source, this) << "to move exception " << session_service->GetExceptions()[n1]->mask << " from position " << n1 + 1 << " to position " << n2 + 1;
source.Reply(_("Exception for \002%s\002 (#%d) moved to position \002%d\002."), session_service->GetExceptions()[n1]->mask.c_str(), n1 + 1, n2 + 1);
if (Anope::ReadOnly)
+3
View File
@@ -21,6 +21,7 @@ class CommandOSQuit : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
Log(LOG_ADMIN, source, this);
Anope::QuitReason = source.command + " command received from " + source.GetNick();
Anope::Quitting = true;
return;
@@ -48,6 +49,7 @@ class CommandOSRestart : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
Log(LOG_ADMIN, source, this);
Anope::QuitReason = source.command + " command received from " + source.GetNick();
Anope::Quitting = Anope::Restarting = true;
Anope::SaveDatabases();
@@ -73,6 +75,7 @@ class CommandOSShutdown : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
Log(LOG_ADMIN, source, this);
Anope::QuitReason = source.command + " command received from " + source.GetNick();
Anope::Quitting = true;
Anope::SaveDatabases();
+2
View File
@@ -201,6 +201,8 @@ class CommandOSStats : public Command
{
Anope::string extra = !params.empty() ? params[0] : "";
Log(LOG_ADMIN, source, this) << extra;
if (extra.equals_ci("RESET"))
return this->DoStatsReset(source);
+1
View File
@@ -21,6 +21,7 @@ class CommandOSUpdate : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
Log(LOG_ADMIN, source, this);
source.Reply(_("Updating databases."));
Anope::SaveDatabases();
return;