summaryrefslogtreecommitdiff
path: root/modules/commands/cs_log.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/commands/cs_log.cpp')
-rw-r--r--modules/commands/cs_log.cpp44
1 files changed, 23 insertions, 21 deletions
diff --git a/modules/commands/cs_log.cpp b/modules/commands/cs_log.cpp
index 9fd1a2fdf..5c80448c2 100644
--- a/modules/commands/cs_log.cpp
+++ b/modules/commands/cs_log.cpp
@@ -129,33 +129,35 @@ public:
{
LogSettings *ls = ci->Require<LogSettings>("logsettings");
if (!ls || (*ls)->empty())
- source.Reply(_("There currently are no logging configurations for \002{0}\002."), ci->name);
- else
{
- ListFormatter list(source.GetAccount());
- list.AddColumn(_("Number")).AddColumn(_("Service")).AddColumn(_("Command")).AddColumn(_("Method")).AddColumn("");
+ source.Reply(_("There currently are no logging configurations for \002{0}\002."), ci->name);
+ return;
+ }
- for (unsigned i = 0; i < (*ls)->size(); ++i)
- {
- const LogSetting *log = (*ls)->at(i);
-
- ListFormatter::ListEntry entry;
- entry["Number"] = stringify(i + 1);
- entry["Service"] = log->command_service;
- entry["Command"] = !log->command_name.empty() ? log->command_name : log->service_name;
- entry["Method"] = log->method;
- entry[""] = log->extra;
- list.AddEntry(entry);
- }
- source.Reply(_("Log list for \002{0}\002:"), ci->name);
+ ListFormatter list(source.GetAccount());
+ list.AddColumn(_("Number")).AddColumn(_("Service")).AddColumn(_("Command")).AddColumn(_("Method")).AddColumn("");
- std::vector<Anope::string> replies;
- list.Process(replies);
+ for (unsigned i = 0; i < (*ls)->size(); ++i)
+ {
+ const LogSetting *log = (*ls)->at(i);
- for (unsigned i = 0; i < replies.size(); ++i)
- source.Reply(replies[i]);
+ ListFormatter::ListEntry entry;
+ entry["Number"] = stringify(i + 1);
+ entry["Service"] = log->command_service;
+ entry["Command"] = !log->command_name.empty() ? log->command_name : log->service_name;
+ entry["Method"] = log->method;
+ entry[""] = log->extra;
+ list.AddEntry(entry);
}
+
+ source.Reply(_("Log list for \002{0}\002:"), ci->name);
+
+ std::vector<Anope::string> replies;
+ list.Process(replies);
+
+ for (unsigned i = 0; i < replies.size(); ++i)
+ source.Reply(replies[i]);
}
else if (params.size() > 2)
{