diff options
| author | Adam <Adam@anope.org> | 2017-01-23 12:35:14 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2017-01-23 12:35:14 -0500 |
| commit | 16ca76c2e7ab287e480185fbb03a0bb438351eda (patch) | |
| tree | dfb25534afa2352b65b2ee707086cb5eecc96fbb /modules/extra | |
| parent | ff030c1eb7c3764f9add2a689479e84d616cabcb (diff) | |
Make log system use newer format strings
Also allow log messages to be translatable
Diffstat (limited to 'modules/extra')
| -rw-r--r-- | modules/extra/ldap.cpp | 6 | ||||
| -rw-r--r-- | modules/extra/ldap_authentication.cpp | 4 | ||||
| -rw-r--r-- | modules/extra/mysql.cpp | 8 | ||||
| -rw-r--r-- | modules/extra/sql_authentication.cpp | 6 | ||||
| -rw-r--r-- | modules/extra/sql_log.cpp | 16 | ||||
| -rw-r--r-- | modules/extra/sql_oper.cpp | 6 | ||||
| -rw-r--r-- | modules/extra/ssl_gnutls.cpp | 4 | ||||
| -rw-r--r-- | modules/extra/ssl_openssl.cpp | 4 | ||||
| -rw-r--r-- | modules/extra/stats/chanstats.cpp | 12 | ||||
| -rw-r--r-- | modules/extra/stats/cs_fantasy_stats.cpp | 6 | ||||
| -rw-r--r-- | modules/extra/stats/cs_fantasy_top.cpp | 6 |
11 files changed, 39 insertions, 39 deletions
diff --git a/modules/extra/ldap.cpp b/modules/extra/ldap.cpp index 6d4c0bd62..b5c37d7cf 100644 --- a/modules/extra/ldap.cpp +++ b/modules/extra/ldap.cpp @@ -479,7 +479,7 @@ class ModuleLDAP : public Module, public Pipe if (i == conf->CountBlock("ldap")) { - Log(LOG_NORMAL, "ldap") << "LDAP: Removing server connection " << cname; + Log(LogType::NORMAL, "ldap") << "LDAP: Removing server connection " << cname; s->SetExitState(); s->Wakeup(); @@ -507,11 +507,11 @@ class ModuleLDAP : public Module, public Pipe ss->Start(); this->LDAPServices.insert(std::make_pair(connname, ss)); - Log(LOG_NORMAL, "ldap") << "LDAP: Successfully initialized server " << connname << " (" << server << ")"; + Log(LogType::NORMAL, "ldap") << "LDAP: Successfully initialized server " << connname << " (" << server << ")"; } catch (const LDAPException &ex) { - Log(LOG_NORMAL, "ldap") << "LDAP: " << ex.GetReason(); + Log(LogType::NORMAL, "ldap") << "LDAP: " << ex.GetReason(); } } } diff --git a/modules/extra/ldap_authentication.cpp b/modules/extra/ldap_authentication.cpp index 8160eb6e2..722284fb4 100644 --- a/modules/extra/ldap_authentication.cpp +++ b/modules/extra/ldap_authentication.cpp @@ -80,7 +80,7 @@ class IdentifyInterface : public LDAPInterface { const LDAPAttributes &attr = r.get(0); ii->dn = attr.get("dn"); - Log(LOG_DEBUG) << "m_ldap_authenticationn: binding as " << ii->dn; + Log(LogType::DEBUG) << "m_ldap_authenticationn: binding as " << ii->dn; ii->lprov->Bind(new IdentifyInterface(this->owner, ii), ii->dn, ii->req->GetPassword()); ii = NULL; @@ -99,7 +99,7 @@ class IdentifyInterface : public LDAPInterface Anope::string sf = search_filter.replace_all_cs("%account", ii->req->GetAccount()).replace_all_cs("%object_class", object_class); try { - Log(LOG_DEBUG) << "m_ldap_authentication: searching for " << sf; + Log(LogType::DEBUG) << "m_ldap_authentication: searching for " << sf; ii->lprov->Search(new IdentifyInterface(this->owner, ii), basedn, sf); ii->admin_bind = false; ii = NULL; diff --git a/modules/extra/mysql.cpp b/modules/extra/mysql.cpp index a5d1ac163..66b4ffa85 100644 --- a/modules/extra/mysql.cpp +++ b/modules/extra/mysql.cpp @@ -241,7 +241,7 @@ class ModuleSQL : public Module if (i == config->CountBlock("mysql")) { - Log(LOG_NORMAL, "mysql") << "MySQL: Removing server connection " << cname; + Log(LogType::NORMAL, "mysql") << "MySQL: Removing server connection " << cname; delete s; this->MySQLServices.erase(cname); @@ -266,11 +266,11 @@ class ModuleSQL : public Module MySQLService *ss = new MySQLService(this, connname, database, server, user, password, port); this->MySQLServices.insert(std::make_pair(connname, ss)); - Log(LOG_NORMAL, "mysql") << "MySQL: Successfully connected to server " << connname << " (" << server << ")"; + Log(LogType::NORMAL, "mysql") << "MySQL: Successfully connected to server " << connname << " (" << server << ")"; } catch (const SQL::Exception &ex) { - Log(LOG_NORMAL, "mysql") << "MySQL: " << ex.GetReason(); + Log(LogType::NORMAL, "mysql") << "MySQL: " << ex.GetReason(); } } } @@ -542,7 +542,7 @@ void MySQLService::Connect() if (!connect) throw SQL::Exception("Unable to connect to MySQL service " + this->GetName() + ": " + mysql_error(this->sql)); - Log(LOG_DEBUG) << "Successfully connected to MySQL service " << this->GetName() << " at " << this->server << ":" << this->port; + Log(LogType::DEBUG) << "Successfully connected to MySQL service " << this->GetName() << " at " << this->server << ":" << this->port; } diff --git a/modules/extra/sql_authentication.cpp b/modules/extra/sql_authentication.cpp index 98128d325..0ea457ea3 100644 --- a/modules/extra/sql_authentication.cpp +++ b/modules/extra/sql_authentication.cpp @@ -43,12 +43,12 @@ class SQLAuthenticationResult : public SQL::Interface { if (r.Rows() == 0) { - Log(LOG_DEBUG) << "m_sql_authentication: Unsuccessful authentication for " << req->GetAccount(); + Log(LogType::DEBUG) << "m_sql_authentication: Unsuccessful authentication for " << req->GetAccount(); delete this; return; } - Log(LOG_DEBUG) << "m_sql_authentication: Successful authentication for " << req->GetAccount(); + Log(LogType::DEBUG) << "m_sql_authentication: Successful authentication for " << req->GetAccount(); Anope::string email; try @@ -155,7 +155,7 @@ class ModuleSQLAuthentication : public Module this->SQL->Run(new SQLAuthenticationResult(u, req), q); - Log(LOG_DEBUG) << "m_sql_authentication: Checking authentication for " << req->GetAccount(); + Log(LogType::DEBUG) << "m_sql_authentication: Checking authentication for " << req->GetAccount(); } }; diff --git a/modules/extra/sql_log.cpp b/modules/extra/sql_log.cpp index 320350ced..d561a0fb2 100644 --- a/modules/extra/sql_log.cpp +++ b/modules/extra/sql_log.cpp @@ -79,28 +79,28 @@ class SQLLog : public Module switch (l->type) { - case LOG_ADMIN: + case LogType::ADMIN: insert.SetValue("type", "ADMIN"); break; - case LOG_OVERRIDE: + case LogType::OVERRIDE: insert.SetValue("type", "OVERRIDE"); break; - case LOG_COMMAND: + case LogType::COMMAND: insert.SetValue("type", "COMMAND"); break; - case LOG_SERVER: + case LogType::SERVER: insert.SetValue("type", "SERVER"); break; - case LOG_CHANNEL: + case LogType::CHANNEL: insert.SetValue("type", "CHANNEL"); break; - case LOG_USER: + case LogType::USER: insert.SetValue("type", "USER"); break; - case LOG_MODULE: + case LogType::MODULE: insert.SetValue("type", "MODULE"); break; - case LOG_NORMAL: + case LogType::NORMAL: insert.SetValue("type", "NORMAL"); break; default: diff --git a/modules/extra/sql_oper.cpp b/modules/extra/sql_oper.cpp index 9dfcfe772..4beb3d39f 100644 --- a/modules/extra/sql_oper.cpp +++ b/modules/extra/sql_oper.cpp @@ -55,7 +55,7 @@ class SQLOperResult : public SQL::Interface if (r.Rows() == 0) { - Log(LOG_DEBUG) << "m_sql_oper: Got 0 rows for " << user->nick; + Log(LogType::DEBUG) << "m_sql_oper: Got 0 rows for " << user->nick; Deoper(); return; } @@ -71,7 +71,7 @@ class SQLOperResult : public SQL::Interface return; } - Log(LOG_DEBUG) << "m_sql_oper: Got result for " << user->nick << ", opertype " << opertype; + Log(LogType::DEBUG) << "m_sql_oper: Got result for " << user->nick << ", opertype " << opertype; Anope::string modes; try @@ -163,7 +163,7 @@ class ModuleSQLOper : public Module this->SQL->Run(new SQLOperResult(this, u), q); - Log(LOG_DEBUG) << "m_sql_oper: Checking authentication for " << u->Account()->GetDisplay(); + Log(LogType::DEBUG) << "m_sql_oper: Checking authentication for " << u->Account()->GetDisplay(); } }; diff --git a/modules/extra/ssl_gnutls.cpp b/modules/extra/ssl_gnutls.cpp index 223b72519..eecd6825e 100644 --- a/modules/extra/ssl_gnutls.cpp +++ b/modules/extra/ssl_gnutls.cpp @@ -371,7 +371,7 @@ class GnuTLSModule : public Module delete newcred; throw; } - Log(LOG_DEBUG) << "m_ssl_gnutls: Successfully loaded DH parameters from " << dhfile; + Log(LogType::DEBUG) << "m_ssl_gnutls: Successfully loaded DH parameters from " << dhfile; } if (cred) @@ -379,7 +379,7 @@ class GnuTLSModule : public Module cred = newcred; cred->incrref(); - Log(LOG_DEBUG) << "m_ssl_gnutls: Successfully loaded certificate " << certfile << " and private key " << keyfile; + Log(LogType::DEBUG) << "m_ssl_gnutls: Successfully loaded certificate " << certfile << " and private key " << keyfile; } void OnPreServerConnect() override diff --git a/modules/extra/ssl_openssl.cpp b/modules/extra/ssl_openssl.cpp index 22f421d35..20673b5ef 100644 --- a/modules/extra/ssl_openssl.cpp +++ b/modules/extra/ssl_openssl.cpp @@ -163,7 +163,7 @@ class SSLModule : public Module if (!SSL_CTX_use_certificate_chain_file(client_ctx, this->certfile.c_str()) || !SSL_CTX_use_certificate_chain_file(server_ctx, this->certfile.c_str())) throw ConfigException("Error loading certificate"); else - Log(LOG_DEBUG) << "m_ssl_openssl: Successfully loaded certificate " << this->certfile; + Log(LogType::DEBUG) << "m_ssl_openssl: Successfully loaded certificate " << this->certfile; } else Log() << "Unable to open certificate " << this->certfile; @@ -173,7 +173,7 @@ class SSLModule : public Module if (!SSL_CTX_use_PrivateKey_file(client_ctx, this->keyfile.c_str(), SSL_FILETYPE_PEM) || !SSL_CTX_use_PrivateKey_file(server_ctx, this->keyfile.c_str(), SSL_FILETYPE_PEM)) throw ConfigException("Error loading private key"); else - Log(LOG_DEBUG) << "m_ssl_openssl: Successfully loaded private key " << this->keyfile; + Log(LogType::DEBUG) << "m_ssl_openssl: Successfully loaded private key " << this->keyfile; } else { diff --git a/modules/extra/stats/chanstats.cpp b/modules/extra/stats/chanstats.cpp index 65a198449..adc002c8c 100644 --- a/modules/extra/stats/chanstats.cpp +++ b/modules/extra/stats/chanstats.cpp @@ -34,11 +34,11 @@ class CommandCSSetChanstats : public Command { ci->Extend<bool>("CS_STATS"); source.Reply(_("Chanstats statistics are now enabled for this channel.")); - Log(source.AccessFor(ci).HasPriv("SET") ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to enable chanstats"; + Log(source.AccessFor(ci).HasPriv("SET") ? LogType::COMMAND : LogType::OVERRIDE, source, this, ci) << "to enable chanstats"; } else if (params[1].equals_ci("OFF")) { - Log(source.AccessFor(ci).HasPriv("SET") ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to disable chanstats"; + Log(source.AccessFor(ci).HasPriv("SET") ? LogType::COMMAND : LogType::OVERRIDE, source, this, ci) << "to disable chanstats"; ci->Shrink<bool>("CS_STATS"); source.Reply(_("Chanstats statistics are now disabled for this channel.")); } @@ -79,7 +79,7 @@ class CommandNSSetChanstats : public Command if (param.equals_ci("ON")) { - Log(na->GetAccount() == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to enable chanstats for " << na->GetAccount()->GetDisplay(); + Log(na->GetAccount() == source.GetAccount() ? LogType::COMMAND : LogType::ADMIN, source, this) << "to enable chanstats for " << na->GetAccount()->GetDisplay(); na->GetAccount()->Extend<bool>("NS_STATS"); if (saset) source.Reply(_("Chanstats statistics are now enabled for %s"), na->GetAccount()->GetDisplay().c_str()); @@ -88,7 +88,7 @@ class CommandNSSetChanstats : public Command } else if (param.equals_ci("OFF")) { - Log(na->GetAccount() == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to disable chanstats for " << na->GetAccount()->GetDisplay(); + Log(na->GetAccount() == source.GetAccount() ? LogType::COMMAND : LogType::ADMIN, source, this) << "to disable chanstats for " << na->GetAccount()->GetDisplay(); na->GetAccount()->Shrink<bool>("NS_STATS"); if (saset) source.Reply(_("Chanstats statistics are now disabled for %s"), na->GetAccount()->GetDisplay().c_str()); @@ -148,9 +148,9 @@ class MySQLInterface : public SQL::Interface void OnError(const SQL::Result &r) override { if (!r.GetQuery().query.empty()) - Log(LOG_DEBUG) << "Chanstats: Error executing query " << r.finished_query << ": " << r.GetError(); + Log(LogType::DEBUG) << "Chanstats: Error executing query " << r.finished_query << ": " << r.GetError(); else - Log(LOG_DEBUG) << "Chanstats: Error executing query: " << r.GetError(); + Log(LogType::DEBUG) << "Chanstats: Error executing query: " << r.GetError(); } }; diff --git a/modules/extra/stats/cs_fantasy_stats.cpp b/modules/extra/stats/cs_fantasy_stats.cpp index 78dce14f1..1cbc4cd15 100644 --- a/modules/extra/stats/cs_fantasy_stats.cpp +++ b/modules/extra/stats/cs_fantasy_stats.cpp @@ -24,9 +24,9 @@ class MySQLInterface : public SQL::Interface void OnError(const SQL::Result &r) override { if (!r.GetQuery().query.empty()) - Log(LOG_DEBUG) << "Chanstats: Error executing query " << r.finished_query << ": " << r.GetError(); + Log(LogType::DEBUG) << "Chanstats: Error executing query " << r.finished_query << ": " << r.GetError(); else - Log(LOG_DEBUG) << "Chanstats: Error executing query: " << r.GetError(); + Log(LogType::DEBUG) << "Chanstats: Error executing query: " << r.GetError(); } }; @@ -157,7 +157,7 @@ class CSStats : public Module } catch (const SQL::Exception &ex) { - Log(LOG_DEBUG) << ex.GetReason(); + Log(LogType::DEBUG) << ex.GetReason(); } } diff --git a/modules/extra/stats/cs_fantasy_top.cpp b/modules/extra/stats/cs_fantasy_top.cpp index 961b2f903..2be1d2f1c 100644 --- a/modules/extra/stats/cs_fantasy_top.cpp +++ b/modules/extra/stats/cs_fantasy_top.cpp @@ -24,9 +24,9 @@ class MySQLInterface : public SQL::Interface void OnError(const SQL::Result &r) override { if (!r.GetQuery().query.empty()) - Log(LOG_DEBUG) << "Chanstats: Error executing query " << r.finished_query << ": " << r.GetError(); + Log(LogType::DEBUG) << "Chanstats: Error executing query " << r.finished_query << ": " << r.GetError(); else - Log(LOG_DEBUG) << "Chanstats: Error executing query: " << r.GetError(); + Log(LogType::DEBUG) << "Chanstats: Error executing query: " << r.GetError(); } }; @@ -160,7 +160,7 @@ class CSTop : public Module } catch (const SQL::Exception &ex) { - Log(LOG_DEBUG) << ex.GetReason(); + Log(LogType::DEBUG) << ex.GetReason(); } } }; |
