diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bots.cpp | 4 | ||||
-rw-r--r-- | src/logger.cpp | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index 25ead29f5..390fc6a69 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -229,7 +229,7 @@ void BotInfo::OnMessage(User *u, const Anope::string &message) if (!c->HasFlag(CFLAG_ALLOW_UNREGISTERED) && !u->IsIdentified()) { u->SendMessage(this, NICK_IDENTIFY_REQUIRED); - Log(LOG_NORMAL, "denied", this) << "Access denied for unregistered user " << u->GetMask() << " with command " << c->name; + Log(LOG_NORMAL, "access_denied", this) << "Access denied for unregistered user " << u->GetMask() << " with command " << c->name; return; } @@ -266,7 +266,7 @@ void BotInfo::OnMessage(User *u, const Anope::string &message) if (!info.permission.empty() && !u->HasCommand(info.permission)) { u->SendMessage(this, ACCESS_DENIED); - Log(LOG_COMMAND, "denied", this) << "Access denied for user " << u->GetMask() << " with command " << c->name; + Log(LOG_NORMAL, "access_denied", this) << "Access denied for user " << u->GetMask() << " with command " << c->name; return; } diff --git a/src/logger.cpp b/src/logger.cpp index d21a63e5a..648a0da5f 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -164,6 +164,8 @@ Anope::string Log::BuildPrefix() const { case LOG_ADMIN: { + if (!this->c) + break; buffer += "ADMIN: "; size_t sl = this->c->name.find('/'); Anope::string cname = sl != Anope::string::npos ? this->c->name.substr(sl + 1) : this->c->name; @@ -174,6 +176,8 @@ Anope::string Log::BuildPrefix() const } case LOG_OVERRIDE: { + if (!this->c) + break; buffer += "OVERRIDE: "; size_t sl = this->c->name.find('/'); Anope::string cname = sl != Anope::string::npos ? this->c->name.substr(sl + 1) : this->c->name; @@ -184,6 +188,8 @@ Anope::string Log::BuildPrefix() const } case LOG_COMMAND: { + if (!this->c) + break; buffer += "COMMAND: "; size_t sl = this->c->name.find('/'); Anope::string cname = sl != Anope::string::npos ? this->c->name.substr(sl + 1) : this->c->name; |