diff options
author | Peter Powell <petpow@saberuk.com> | 2013-08-04 13:46:17 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2013-08-04 14:59:20 +0100 |
commit | cc1d8c1d57abc36effdc1e9383e4d7f5a3ea9ab0 (patch) | |
tree | 1136c86e37046d5717bbb9aea97ae558ef4adbe2 /src/modules | |
parent | 24623a5fe6ff986ad342e2b00d3576b4899a6033 (diff) |
Modify the log message to contain the log type.
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 18 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 14 | ||||
-rw-r--r-- | src/modules/m_cgiirc.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_filter.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_permchannels.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_spanningtree/utils.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_sqloper.cpp | 10 | ||||
-rw-r--r-- | src/modules/m_xline_db.cpp | 20 |
8 files changed, 39 insertions, 39 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index c1b5e49e9..68e12e208 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -654,7 +654,7 @@ class ModuleSSLGnuTLS : public Module continue; const std::string& portid = port->bind_desc; - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %s", portid.c_str()); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Enabling SSL for port %s", portid.c_str()); if (port->bind_tag->getString("type", "clients") == "clients" && port->bind_addr != "127.0.0.1") { @@ -751,13 +751,13 @@ class ModuleSSLGnuTLS : public Module ret = gnutls_certificate_allocate_credentials(&iohook.x509_cred); cred_alloc = (ret >= 0); if (!cred_alloc) - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "m_ssl_gnutls.so: Failed to allocate certificate credentials: %s", gnutls_strerror(ret)); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Failed to allocate certificate credentials: %s", gnutls_strerror(ret)); if((ret =gnutls_certificate_set_x509_trust_file(iohook.x509_cred, cafile.c_str(), GNUTLS_X509_FMT_PEM)) < 0) - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "m_ssl_gnutls.so: Failed to set X.509 trust file '%s': %s", cafile.c_str(), gnutls_strerror(ret)); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Failed to set X.509 trust file '%s': %s", cafile.c_str(), gnutls_strerror(ret)); if((ret = gnutls_certificate_set_x509_crl_file (iohook.x509_cred, crlfile.c_str(), GNUTLS_X509_FMT_PEM)) < 0) - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "m_ssl_gnutls.so: Failed to set X.509 CRL file '%s': %s", crlfile.c_str(), gnutls_strerror(ret)); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Failed to set X.509 CRL file '%s': %s", crlfile.c_str(), gnutls_strerror(ret)); FileReader reader; @@ -806,13 +806,13 @@ class ModuleSSLGnuTLS : public Module if ((ret = gnutls_priority_init(&iohook.priority, priocstr, &prioerror)) < 0) { // gnutls did not understand the user supplied string, log and fall back to the default priorities - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "m_ssl_gnutls.so: Failed to set priorities to \"%s\": %s Syntax error at position %u, falling back to default (NORMAL)", priorities.c_str(), gnutls_strerror(ret), (unsigned int) (prioerror - priocstr)); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Failed to set priorities to \"%s\": %s Syntax error at position %u, falling back to default (NORMAL)", priorities.c_str(), gnutls_strerror(ret), (unsigned int) (prioerror - priocstr)); gnutls_priority_init(&iohook.priority, "NORMAL", NULL); } #else if (priorities != "NORMAL") - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "m_ssl_gnutls.so: You've set <gnutls:priority> to a value other than the default, but this is only supported with GnuTLS v2.1.7 or newer. Your GnuTLS version is older than that so the option will have no effect."); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "You've set <gnutls:priority> to a value other than the default, but this is only supported with GnuTLS v2.1.7 or newer. Your GnuTLS version is older than that so the option will have no effect."); #endif #if(GNUTLS_VERSION_MAJOR < 2 || ( GNUTLS_VERSION_MAJOR == 2 && GNUTLS_VERSION_MINOR < 12 ) ) @@ -824,7 +824,7 @@ class ModuleSSLGnuTLS : public Module dh_alloc = (ret >= 0); if (!dh_alloc) { - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "m_ssl_gnutls.so: Failed to initialise DH parameters: %s", gnutls_strerror(ret)); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Failed to initialise DH parameters: %s", gnutls_strerror(ret)); return; } @@ -839,7 +839,7 @@ class ModuleSSLGnuTLS : public Module if ((ret = gnutls_dh_params_import_pkcs3(dh_params, &dh_datum, GNUTLS_X509_FMT_PEM)) < 0) { // File unreadable or GnuTLS was unhappy with the contents, generate the DH primes now - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "m_ssl_gnutls.so: Generating DH parameters because I failed to load them from file '%s': %s", dhfile.c_str(), gnutls_strerror(ret)); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Generating DH parameters because I failed to load them from file '%s': %s", dhfile.c_str(), gnutls_strerror(ret)); GenerateDHParams(); } } @@ -862,7 +862,7 @@ class ModuleSSLGnuTLS : public Module int ret; if((ret = gnutls_dh_params_generate2(dh_params, iohook.dh_bits)) < 0) - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "m_ssl_gnutls.so: Failed to generate DH parameters (%d bits): %s", iohook.dh_bits, gnutls_strerror(ret)); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Failed to generate DH parameters (%d bits): %s", iohook.dh_bits, gnutls_strerror(ret)); } ~ModuleSSLGnuTLS() diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 2cf8a16d1..a0043b7aa 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -527,7 +527,7 @@ class ModuleSSLOpenSSL : public Module continue; const std::string& portid = port->bind_desc; - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %s", portid.c_str()); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Enabling SSL for port %s", portid.c_str()); if (port->bind_tag->getString("type", "clients") == "clients" && port->bind_addr != "127.0.0.1") { @@ -579,7 +579,7 @@ class ModuleSSLOpenSSL : public Module { if ((!SSL_CTX_set_cipher_list(ctx, ciphers.c_str())) || (!SSL_CTX_set_cipher_list(clictx, ciphers.c_str()))) { - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "m_ssl_openssl.so: Can't set cipher list to %s.", ciphers.c_str()); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Can't set cipher list to %s.", ciphers.c_str()); ERR_print_errors_cb(error_callback, this); } } @@ -589,20 +589,20 @@ class ModuleSSLOpenSSL : public Module */ if ((!SSL_CTX_use_certificate_chain_file(ctx, certfile.c_str())) || (!SSL_CTX_use_certificate_chain_file(clictx, certfile.c_str()))) { - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "m_ssl_openssl.so: Can't read certificate file %s. %s", certfile.c_str(), strerror(errno)); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Can't read certificate file %s. %s", certfile.c_str(), strerror(errno)); ERR_print_errors_cb(error_callback, this); } if (((!SSL_CTX_use_PrivateKey_file(ctx, keyfile.c_str(), SSL_FILETYPE_PEM))) || (!SSL_CTX_use_PrivateKey_file(clictx, keyfile.c_str(), SSL_FILETYPE_PEM))) { - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "m_ssl_openssl.so: Can't read key file %s. %s", keyfile.c_str(), strerror(errno)); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Can't read key file %s. %s", keyfile.c_str(), strerror(errno)); ERR_print_errors_cb(error_callback, this); } /* Load the CAs we trust*/ if (((!SSL_CTX_load_verify_locations(ctx, cafile.c_str(), 0))) || (!SSL_CTX_load_verify_locations(clictx, cafile.c_str(), 0))) { - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "m_ssl_openssl.so: Can't read CA list from %s. This is only a problem if you want to verify client certificates, otherwise it's safe to ignore this message. Error: %s", cafile.c_str(), strerror(errno)); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Can't read CA list from %s. This is only a problem if you want to verify client certificates, otherwise it's safe to ignore this message. Error: %s", cafile.c_str(), strerror(errno)); ERR_print_errors_cb(error_callback, this); } @@ -611,7 +611,7 @@ class ModuleSSLOpenSSL : public Module if (dhpfile == NULL) { - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "m_ssl_openssl.so Couldn't open DH file %s: %s", dhfile.c_str(), strerror(errno)); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Couldn't open DH file %s: %s", dhfile.c_str(), strerror(errno)); throw ModuleException("Couldn't open DH file " + dhfile + ": " + strerror(errno)); } else @@ -619,7 +619,7 @@ class ModuleSSLOpenSSL : public Module ret = PEM_read_DHparams(dhpfile, NULL, NULL, NULL); if ((SSL_CTX_set_tmp_dh(ctx, ret) < 0) || (SSL_CTX_set_tmp_dh(clictx, ret) < 0)) { - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "m_ssl_openssl.so: Couldn't set DH parameters %s. SSL errors follow:", dhfile.c_str()); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Couldn't set DH parameters %s. SSL errors follow:", dhfile.c_str()); ERR_print_errors_cb(error_callback, this); } } diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 740ae0438..cac143f39 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -279,7 +279,7 @@ public: else { cgitype = PASS; - ServerInstance->Logs->Log("CONFIG", LOG_DEFAULT, "m_cgiirc.so: Invalid <cgihost:type> value in config: %s, setting it to \"pass\"", type.c_str()); + ServerInstance->Logs->Log("CONFIG", LOG_DEFAULT, "Invalid <cgihost:type> value in config: %s, setting it to \"pass\"", type.c_str()); } cmd.Hosts.push_back(CGIhost(hostmask, cgitype, password)); @@ -287,7 +287,7 @@ public: } else { - ServerInstance->Logs->Log("CONFIG", LOG_DEFAULT, "m_cgiirc.so: Invalid <cgihost:mask> value in config: %s", hostmask.c_str()); + ServerInstance->Logs->Log("CONFIG", LOG_DEFAULT, "Invalid <cgihost:mask> value in config: %s", hostmask.c_str()); continue; } } diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index c0fc47b64..e4d4a71aa 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -375,7 +375,7 @@ ModResult ModuleFilter::OnUserPreMessage(User* user, void* dest, int target_type delete gl; } - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "FILTER: "+ user->nick + " had their message filtered, target was " + target + ": " + f->reason + " Action: " + ModuleFilter::FilterActionToString(f->action)); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, user->nick + " had their message filtered, target was " + target + ": " + f->reason + " Action: " + ModuleFilter::FilterActionToString(f->action)); return MOD_RES_DENY; } return MOD_RES_PASSTHRU; diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index c6297ac7b..704745f57 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.cpp @@ -64,7 +64,7 @@ static bool WriteDatabase(PermChannel& permchanmode) std::ofstream stream(permchannelsnewconf.c_str()); if (!stream.is_open()) { - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "permchannels: Cannot create database! %s (%d)", strerror(errno), errno); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Cannot create database! %s (%d)", strerror(errno), errno); ServerInstance->SNO->WriteToSnoMask('a', "database: cannot create new db: %s (%d)", strerror(errno), errno); return false; } @@ -86,7 +86,7 @@ static bool WriteDatabase(PermChannel& permchanmode) if (stream.fail()) { - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "permchannels: Cannot write to new database! %s (%d)", strerror(errno), errno); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Cannot write to new database! %s (%d)", strerror(errno), errno); ServerInstance->SNO->WriteToSnoMask('a', "database: cannot write to new db: %s (%d)", strerror(errno), errno); return false; } @@ -95,7 +95,7 @@ static bool WriteDatabase(PermChannel& permchanmode) #ifdef _WIN32 if (remove(permchannelsconf.c_str())) { - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "permchannels: Cannot remove old database! %s (%d)", strerror(errno), errno); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Cannot remove old database! %s (%d)", strerror(errno), errno); ServerInstance->SNO->WriteToSnoMask('a', "database: cannot remove old database: %s (%d)", strerror(errno), errno); return false; } @@ -103,7 +103,7 @@ static bool WriteDatabase(PermChannel& permchanmode) // Use rename to move temporary to new db - this is guarenteed not to fuck up, even in case of a crash. if (rename(permchannelsnewconf.c_str(), permchannelsconf.c_str()) < 0) { - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "permchannels: Cannot move new to old database! %s (%d)", strerror(errno), errno); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Cannot move new to old database! %s (%d)", strerror(errno), errno); ServerInstance->SNO->WriteToSnoMask('a', "database: cannot replace old with new db: %s (%d)", strerror(errno), errno); return false; } diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index 9739cfafb..c689676a9 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -274,7 +274,7 @@ void SpanningTreeUtilities::RefreshIPCache() Link* L = *i; if (!L->Port) { - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "m_spanningtree: Ignoring a link block without a port."); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Ignoring a link block without a port."); /* Invalid link block */ continue; } diff --git a/src/modules/m_sqloper.cpp b/src/modules/m_sqloper.cpp index cbf2450a0..b59225ee8 100644 --- a/src/modules/m_sqloper.cpp +++ b/src/modules/m_sqloper.cpp @@ -32,7 +32,7 @@ class OpMeQuery : public SQLQuery void OnResult(SQLResult& res) CXX11_OVERRIDE { - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "SQLOPER: result for %s", uid.c_str()); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "result for %s", uid.c_str()); User* user = ServerInstance->FindNick(uid); if (!user) return; @@ -44,14 +44,14 @@ class OpMeQuery : public SQLQuery if (OperUser(user, row[0], row[1])) return; } - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "SQLOPER: no matches for %s (checked %d rows)", uid.c_str(), res.Rows()); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "no matches for %s (checked %d rows)", uid.c_str(), res.Rows()); // nobody succeeded... fall back to OPER fallback(); } void OnError(SQLerror& error) CXX11_OVERRIDE { - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "SQLOPER: query failed (%s)", error.Str()); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "query failed (%s)", error.Str()); fallback(); } @@ -81,7 +81,7 @@ class OpMeQuery : public SQLQuery OperIndex::iterator iter = ServerInstance->Config->oper_blocks.find(" " + type); if (iter == ServerInstance->Config->oper_blocks.end()) { - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "SQLOPER: bad type '%s' in returned row for oper %s", type.c_str(), username.c_str()); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "bad type '%s' in returned row for oper %s", type.c_str(), username.c_str()); return false; } OperInfo* ifo = iter->second; @@ -143,7 +143,7 @@ public: /* Query is in progress, it will re-invoke OPER if needed */ return MOD_RES_DENY; } - ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "SQLOPER: database not present"); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "database not present"); } return MOD_RES_PASSTHRU; } diff --git a/src/modules/m_xline_db.cpp b/src/modules/m_xline_db.cpp index 341d1c524..26c108609 100644 --- a/src/modules/m_xline_db.cpp +++ b/src/modules/m_xline_db.cpp @@ -88,17 +88,17 @@ class ModuleXLineDB : public Module * Technically, that means that this can block, but I have *never* seen that. * -- w00t */ - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "xlinedb: Opening temporary database"); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Opening temporary database"); std::string xlinenewdbpath = xlinedbpath + ".new"; std::ofstream stream(xlinenewdbpath.c_str()); if (!stream.is_open()) { - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "xlinedb: Cannot create database! %s (%d)", strerror(errno), errno); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Cannot create database! %s (%d)", strerror(errno), errno); ServerInstance->SNO->WriteToSnoMask('a', "database: cannot create new db: %s (%d)", strerror(errno), errno); return false; } - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "xlinedb: Opened. Writing.."); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Opened. Writing.."); /* * Now, much as I hate writing semi-unportable formats, additional @@ -126,11 +126,11 @@ class ModuleXLineDB : public Module } } - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "xlinedb: Finished writing XLines. Checking for error.."); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Finished writing XLines. Checking for error.."); if (stream.fail()) { - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "xlinedb: Cannot write to new database! %s (%d)", strerror(errno), errno); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Cannot write to new database! %s (%d)", strerror(errno), errno); ServerInstance->SNO->WriteToSnoMask('a', "database: cannot write to new db: %s (%d)", strerror(errno), errno); return false; } @@ -139,7 +139,7 @@ class ModuleXLineDB : public Module #ifdef _WIN32 if (remove(xlinedbpath.c_str())) { - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "xlinedb: Cannot remove old database! %s (%d)", strerror(errno), errno); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Cannot remove old database! %s (%d)", strerror(errno), errno); ServerInstance->SNO->WriteToSnoMask('a', "database: cannot remove old database: %s (%d)", strerror(errno), errno); return false; } @@ -147,7 +147,7 @@ class ModuleXLineDB : public Module // Use rename to move temporary to new db - this is guarenteed not to fuck up, even in case of a crash. if (rename(xlinenewdbpath.c_str(), xlinedbpath.c_str()) < 0) { - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "xlinedb: Cannot move new to old database! %s (%d)", strerror(errno), errno); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Cannot move new to old database! %s (%d)", strerror(errno), errno); ServerInstance->SNO->WriteToSnoMask('a', "database: cannot replace old with new db: %s (%d)", strerror(errno), errno); return false; } @@ -164,7 +164,7 @@ class ModuleXLineDB : public Module std::ifstream stream(xlinedbpath.c_str()); if (!stream.is_open()) { - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "xlinedb: Cannot read database! %s (%d)", strerror(errno), errno); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Cannot read database! %s (%d)", strerror(errno), errno); ServerInstance->SNO->WriteToSnoMask('a', "database: cannot read db: %s (%d)", strerror(errno), errno); return false; } @@ -184,14 +184,14 @@ class ModuleXLineDB : public Module items++; } - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "xlinedb: Processing %s", line.c_str()); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Processing %s", line.c_str()); if (command_p[0] == "VERSION") { if (command_p[1] != "1") { stream.close(); - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "xlinedb: I got database version %s - I don't understand it", command_p[1].c_str()); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "I got database version %s - I don't understand it", command_p[1].c_str()); ServerInstance->SNO->WriteToSnoMask('a', "database: I got a database version (%s) I don't understand", command_p[1].c_str()); return false; } |