From d6e1b92059688c8b59df0eedccfb16781d193591 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 27 Oct 2012 08:12:04 -0400 Subject: Add a module log type --- modules/extra/bs_autoassign.cpp | 2 +- modules/extra/m_chanstats.cpp | 2 +- modules/extra/m_dnsbl.cpp | 2 +- modules/extra/m_ldap_authentication.cpp | 20 ++++++++++---------- modules/extra/m_ldap_oper.cpp | 6 +++--- modules/extra/m_mysql.cpp | 2 +- modules/extra/m_sql_authentication.cpp | 4 ++-- modules/extra/m_sql_oper.cpp | 10 +++++----- modules/extra/m_ssl.cpp | 4 ++-- modules/extra/m_xmlrpc.cpp | 4 ++-- 10 files changed, 28 insertions(+), 28 deletions(-) (limited to 'modules/extra') diff --git a/modules/extra/bs_autoassign.cpp b/modules/extra/bs_autoassign.cpp index be4b58cf9..f290a3856 100644 --- a/modules/extra/bs_autoassign.cpp +++ b/modules/extra/bs_autoassign.cpp @@ -34,7 +34,7 @@ class BSAutoAssign : public Module BotInfo *bi = findbot(this->bot); if (bi == NULL) { - Log() << "bs_autoassign is configured to assign bot " << this->bot << ", but it does not exist?"; + Log(this) << "bs_autoassign is configured to assign bot " << this->bot << ", but it does not exist?"; return; } diff --git a/modules/extra/m_chanstats.cpp b/modules/extra/m_chanstats.cpp index 9d9e9dbd8..1c37aa8ec 100644 --- a/modules/extra/m_chanstats.cpp +++ b/modules/extra/m_chanstats.cpp @@ -363,7 +363,7 @@ class MChanstats : public Module if (sql) this->CheckTables(); else - Log() << "Chanstats: no database connection to " << engine; + Log(this) << "no database connection to " << engine; } void OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic) anope_override { diff --git a/modules/extra/m_dnsbl.cpp b/modules/extra/m_dnsbl.cpp index ed9776e84..b860bd64c 100644 --- a/modules/extra/m_dnsbl.cpp +++ b/modules/extra/m_dnsbl.cpp @@ -163,7 +163,7 @@ class ModuleDNSBL : public Module } catch (const SocketException &ex) { - Log() << "m_dnsbl: " << ex.GetReason(); + Log(this) << ex.GetReason(); } } } diff --git a/modules/extra/m_ldap_authentication.cpp b/modules/extra/m_ldap_authentication.cpp index 5469713e2..f2140eb71 100644 --- a/modules/extra/m_ldap_authentication.cpp +++ b/modules/extra/m_ldap_authentication.cpp @@ -75,7 +75,7 @@ class IdentifyInterface : public LDAPInterface } catch (const LDAPException &ex) { - Log() << "m_ldap_authentication: Error binding after search: " << ex.GetReason(); + Log(this->owner) << "m_ldap_authentication: Error binding after search: " << ex.GetReason(); } } break; @@ -95,7 +95,7 @@ class IdentifyInterface : public LDAPInterface } catch (const LDAPException &ex) { - Log() << "m_ldap_authentication: Unable to search for " << sf << ": " << ex.GetReason(); + Log(this->owner) << "m_ldap_authentication: Unable to search for " << sf << ": " << ex.GetReason(); } } else @@ -172,19 +172,19 @@ class OnIdentifyInterface : public LDAPInterface BotInfo *bi = findbot(Config->NickServ); if (bi) u->SendMessage(bi, _("Your email has been updated to \002%s\002"), email.c_str()); - Log() << "m_ldap_authentication: Updated email address for " << u->nick << " (" << u->Account()->display << ") to " << email; + Log(this->owner) << "m_ldap_authentication: Updated email address for " << u->nick << " (" << u->Account()->display << ") to " << email; } } catch (const LDAPException &ex) { - Log() << "m_ldap_authentication: " << ex.GetReason(); + Log(this->owner) << "m_ldap_authentication: " << ex.GetReason(); } } void OnError(const LDAPResult &r) anope_override { this->requests.erase(r.id); - Log() << "m_ldap_authentication: " << r.error; + Log(this->owner) << "m_ldap_authentication: " << r.error; } }; @@ -195,12 +195,12 @@ class OnRegisterInterface : public LDAPInterface void OnResult(const LDAPResult &r) anope_override { - Log() << "m_ldap_authentication: Successfully added newly created account to LDAP"; + Log(this->owner) << "m_ldap_authentication: Successfully added newly created account to LDAP"; } void OnError(const LDAPResult &r) anope_override { - Log() << "m_ldap_authentication: Error adding newly created account to LDAP: " << r.getError(); + Log(this->owner) << "m_ldap_authentication: Error adding newly created account to LDAP: " << r.getError(); } }; @@ -268,7 +268,7 @@ class NSIdentifyLDAP : public Module catch (const LDAPException &ex) { delete ii; - Log() << "m_ldap_authentication: " << ex.GetReason(); + Log(this) << ex.GetReason(); } } @@ -288,7 +288,7 @@ class NSIdentifyLDAP : public Module } catch (const LDAPException &ex) { - Log() << "m_ldap_authentication: " << ex.GetReason(); + Log(this) << ex.GetReason(); } } @@ -325,7 +325,7 @@ class NSIdentifyLDAP : public Module } catch (const LDAPException &ex) { - Log() << "m_ldap_authentication: " << ex.GetReason(); + Log(this) << ex.GetReason(); } } }; diff --git a/modules/extra/m_ldap_oper.cpp b/modules/extra/m_ldap_oper.cpp index 4f1784553..53b3d4d43 100644 --- a/modules/extra/m_ldap_oper.cpp +++ b/modules/extra/m_ldap_oper.cpp @@ -50,7 +50,7 @@ class IdentifyInterface : public LDAPInterface o = new Oper(u->nick, ot); my_opers.insert(o); nc->o = o; - Log() << "m_ldap_oper: Tied " << u->nick << " (" << nc->display << ") to opertype " << ot->GetName(); + Log(this->owner) << "m_ldap_oper: Tied " << u->nick << " (" << nc->display << ") to opertype " << ot->GetName(); } } catch (const LDAPException &ex) @@ -64,7 +64,7 @@ class IdentifyInterface : public LDAPInterface } nc->o = NULL; - Log() << "m_ldap_oper: Removed services operator from " << u->nick << " (" << nc->display << ")"; + Log() << "Removed services operator from " << u->nick << " (" << nc->display << ")"; } } } @@ -127,7 +127,7 @@ class LDAPOper : public Module } catch (const LDAPException &ex) { - Log() << "m_ldapoper: " << ex.GetReason(); + Log() << ex.GetReason(); } } diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp index 94bc51a0f..7f1f965cd 100644 --- a/modules/extra/m_mysql.cpp +++ b/modules/extra/m_mysql.cpp @@ -53,7 +53,7 @@ class MySQLResult : public SQLResult { unsigned num_fields = res ? mysql_num_fields(res) : 0; - /* It is not thread safe to log anything here using Log() now :( */ + /* It is not thread safe to log anything here using Log(this->owner) now :( */ if (!num_fields) return; diff --git a/modules/extra/m_sql_authentication.cpp b/modules/extra/m_sql_authentication.cpp index 9375615ee..9412edc50 100644 --- a/modules/extra/m_sql_authentication.cpp +++ b/modules/extra/m_sql_authentication.cpp @@ -65,7 +65,7 @@ class SQLAuthenticationResult : public SQLInterface void OnError(const SQLResult &r) anope_override { - Log() << "m_sql_authentication: Error executing query " << r.GetQuery().query << ": " << r.GetError(); + Log(this->owner) << "m_sql_authentication: Error executing query " << r.GetQuery().query << ": " << r.GetError(); delete this; } }; @@ -119,7 +119,7 @@ class ModuleSQLAuthentication : public Module { if (!this->SQL) { - Log() << "m_sql_authentication: Unable to find SQL engine"; + Log(this) << "Unable to find SQL engine"; return; } diff --git a/modules/extra/m_sql_oper.cpp b/modules/extra/m_sql_oper.cpp index b834e26ca..22218a646 100644 --- a/modules/extra/m_sql_oper.cpp +++ b/modules/extra/m_sql_oper.cpp @@ -50,7 +50,7 @@ class SQLOperResult : public SQLInterface Config->Opers.erase(it); delete user->Account()->o; user->Account()->o = NULL; - Log() << "m_sql_oper: Removed services operator from " << user->nick << " (" << user->Account()->display << ")"; + Log(this->owner) << "m_sql_oper: Removed services operator from " << user->nick << " (" << user->Account()->display << ")"; user->RemoveMode(findbot(Config->OperServ), UMODE_OPER); // Probably not set, just incase } return; @@ -59,13 +59,13 @@ class SQLOperResult : public SQLInterface OperType *ot = OperType::Find(opertype); if (ot == NULL) { - Log() << "m_sql_oper: Oper " << user->nick << " has type " << opertype << ", but this opertype does not exist?"; + Log(this->owner) << "m_sql_oper: Oper " << user->nick << " has type " << opertype << ", but this opertype does not exist?"; return; } if (!user->Account()->o || user->Account()->o->ot != ot) { - Log() << "m_sql_oper: Tieing oper " << user->nick << " to type " << opertype; + Log(this->owner) << "m_sql_oper: Tieing oper " << user->nick << " to type " << opertype; user->Account()->o = new Oper(user->Account()->display, ot); Config->Opers.push_back(user->Account()->o); } @@ -82,7 +82,7 @@ class SQLOperResult : public SQLInterface void OnError(const SQLResult &r) anope_override { SQLOperResultDeleter d(this); - Log() << "m_sql_oper: Error executing query " << r.GetQuery().query << ": " << r.GetError(); + Log(this->owner) << "m_sql_oper: Error executing query " << r.GetQuery().query << ": " << r.GetError(); } }; @@ -118,7 +118,7 @@ class ModuleSQLOper : public Module { if (!this->SQL) { - Log() << "m_sql_oper: Unable to find SQL engine"; + Log() << "Unable to find SQL engine"; return; } diff --git a/modules/extra/m_ssl.cpp b/modules/extra/m_ssl.cpp index 86373fd7c..adae7a6fe 100644 --- a/modules/extra/m_ssl.cpp +++ b/modules/extra/m_ssl.cpp @@ -122,7 +122,7 @@ class SSLModule : public Module Log(LOG_DEBUG) << "m_ssl: Successfully loaded certificate " << this->certfile; } else - Log() << "m_ssl: Unable to open certificate " << this->certfile; + Log() << "Unable to open certificate " << this->certfile; if (IsFile(this->keyfile.c_str())) { @@ -144,7 +144,7 @@ class SSLModule : public Module throw ModuleException("Error loading private key " + this->keyfile + " - file not found"); } else - Log() << "m_ssl: Unable to open private key " << this->keyfile; + Log() << "Unable to open private key " << this->keyfile; } SSL_CTX_set_mode(client_ctx, SSL_MODE_ENABLE_PARTIAL_WRITE | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER); diff --git a/modules/extra/m_xmlrpc.cpp b/modules/extra/m_xmlrpc.cpp index a804c35d2..ad1c2756b 100644 --- a/modules/extra/m_xmlrpc.cpp +++ b/modules/extra/m_xmlrpc.cpp @@ -286,7 +286,7 @@ class ModuleXMLRPC : public Module if (ssl && !sslref) { - Log() << "m_xmlrpc: Could not enable SSL, is m_ssl loaded?"; + Log(this) << "Could not enable SSL, is m_ssl loaded?"; ssl = false; } @@ -298,7 +298,7 @@ class ModuleXMLRPC : public Module } catch (const SocketException &ex) { - Log() << "m_xmlrpc " << ex.GetReason(); + Log(this) << ex.GetReason(); } } } -- cgit