diff options
| author | 2022-01-18 03:30:22 +0000 | |
|---|---|---|
| committer | 2022-05-01 22:07:14 +0100 | |
| commit | e23ee3fde17a6bb17a9e56c7105f4bbceb36391f (patch) | |
| tree | b5117aa2cc0fe2bee18df3a5dabf0ecc49dbd30e /src/modules | |
| parent | Rewrite the entire logging system. (diff) | |
Rewrite logging calls to use the new APIs.
Diffstat (limited to 'src/modules')
56 files changed, 163 insertions, 163 deletions
diff --git a/src/modules/extra/m_argon2.cpp b/src/modules/extra/m_argon2.cpp index 3df31664c..c1ee37e6c 100644 --- a/src/modules/extra/m_argon2.cpp +++ b/src/modules/extra/m_argon2.cpp @@ -47,7 +47,7 @@ private: return ARGON2_VERSION_13; } - ServerInstance->Logs.Log("MODULE", LOG_DEFAULT, "Unknown Argon2 version (%lu) specified; assuming 13", + ServerInstance->Logs.Normal("MODULE", "Unknown Argon2 version (%lu) specified; assuming 13", version); return ARGON2_VERSION_13; } diff --git a/src/modules/extra/m_geo_maxmind.cpp b/src/modules/extra/m_geo_maxmind.cpp index 177f95f87..52213ad73 100644 --- a/src/modules/extra/m_geo_maxmind.cpp +++ b/src/modules/extra/m_geo_maxmind.cpp @@ -190,13 +190,13 @@ public: Geolocation::Location* location = iter->second; if (location->GetUseCount()) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Preserving geolocation data for %s (%s) with use count %u... ", + ServerInstance->Logs.Debug(MODNAME, "Preserving geolocation data for %s (%s) with use count %u... ", location->GetName().c_str(), location->GetCode().c_str(), location->GetUseCount()); iter++; } else { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Deleting unused geolocation data for %s (%s)", + ServerInstance->Logs.Debug(MODNAME, "Deleting unused geolocation data for %s (%s)", location->GetName().c_str(), location->GetCode().c_str()); delete location; iter = geoapi.locations.erase(iter); diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index d2f3f5c28..34c02fa38 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -328,7 +328,7 @@ public: unsigned int port = static_cast<unsigned int>(config->getUInt("port", 3306, 1, 65535)); if (!mysql_real_connect(connection, host.c_str(), user.c_str(), pass.c_str(), dbname.c_str(), port, NULL, CLIENT_IGNORE_SIGPIPE)) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Unable to connect to the %s MySQL server: %s", + ServerInstance->Logs.Normal(MODNAME, "Unable to connect to the %s MySQL server: %s", GetId().c_str(), mysql_error(connection)); return false; } @@ -337,7 +337,7 @@ public: const std::string charset = config->getString("charset"); if (!charset.empty() && mysql_set_character_set(connection, charset.c_str())) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Could not set character set for %s to \"%s\": %s", + ServerInstance->Logs.Normal(MODNAME, "Could not set character set for %s to \"%s\": %s", GetId().c_str(), charset.c_str(), mysql_error(connection)); return false; } @@ -346,7 +346,7 @@ public: const std::string initialquery = config->getString("initialquery"); if (!initialquery.empty() && mysql_real_query(connection, initialquery.data(), initialquery.length())) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Could not execute initial query \"%s\" for %s: %s", + ServerInstance->Logs.Normal(MODNAME, "Could not execute initial query \"%s\" for %s: %s", initialquery.c_str(), name.c_str(), mysql_error(connection)); return false; } @@ -388,7 +388,7 @@ public: void Submit(SQL::Query* q, const std::string& qs) override { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Executing MySQL query: " + qs); + ServerInstance->Logs.Debug(MODNAME, "Executing MySQL query: " + qs); Parent()->Dispatcher->LockQueue(); Parent()->qq.emplace_back(q, qs, this); Parent()->Dispatcher->UnlockQueueWakeup(); diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index aebf2db8f..86dcfe6ce 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -273,7 +273,7 @@ public: bool HandleConnectError(const char* reason) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Could not connect to the \"%s\" database: %s", + ServerInstance->Logs.Normal(MODNAME, "Could not connect to the \"%s\" database: %s", GetId().c_str(), reason); return false; } @@ -419,7 +419,7 @@ restart: void Submit(SQL::Query *req, const std::string& q) override { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Executing PostgreSQL query: " + q); + ServerInstance->Logs.Debug(MODNAME, "Executing PostgreSQL query: " + q); if (qinprog.q.empty()) { DoQuery(QueueItem(req,q)); @@ -448,7 +448,7 @@ restart: int error; size_t escapedsize = PQescapeStringConn(sql, &buffer[0], parm.data(), parm.length(), &error); if (error) - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "BUG: Apparently PQescapeStringConn() failed"); + ServerInstance->Logs.Debug(MODNAME, "BUG: Apparently PQescapeStringConn() failed"); res.append(&buffer[0], escapedsize); } } @@ -479,7 +479,7 @@ restart: int error; size_t escapedsize = PQescapeStringConn(sql, &buffer[0], parm.data(), parm.length(), &error); if (error) - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "BUG: Apparently PQescapeStringConn() failed"); + ServerInstance->Logs.Debug(MODNAME, "BUG: Apparently PQescapeStringConn() failed"); res.append(&buffer[0], escapedsize); } } diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp index 9459a84cf..a388d3797 100644 --- a/src/modules/extra/m_sqlite3.cpp +++ b/src/modules/extra/m_sqlite3.cpp @@ -111,7 +111,7 @@ public: // Even in case of an error conn must be closed sqlite3_close(conn); conn = NULL; - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "WARNING: Could not open DB with id: " + tag->getString("id")); + ServerInstance->Logs.Normal(MODNAME, "WARNING: Could not open DB with id: " + tag->getString("id")); } } @@ -174,7 +174,7 @@ public: void Submit(SQL::Query* query, const std::string& q) override { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Executing SQLite3 query: " + q); + ServerInstance->Logs.Debug(MODNAME, "Executing SQLite3 query: " + q); Query(query, q); delete query; } diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index f30284e4e..463ecbf03 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -320,7 +320,7 @@ namespace GnuTLS if (gnutls_priority_init(&test, ret.c_str(), NULL) < 0) { // The new token broke the priority string, revert to the previously working one - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Priority string token not recognized: \"%s\"", token.c_str()); + ServerInstance->Logs.Debug(MODNAME, "Priority string token not recognized: \"%s\"", token.c_str()); ret.erase(prevpos); } else @@ -526,12 +526,12 @@ namespace GnuTLS { // Stripping failed, act as if a prio string wasn't set stripped = GnuTLS::Priority::RemoveUnknownTokens(GnuTLS::Priority::GetDefault()); - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Priority string for profile \"%s\" contains unknown tokens and stripping it didn't yield a working one either, falling back to \"%s\"", profilename.c_str(), stripped.c_str()); + ServerInstance->Logs.Normal(MODNAME, "Priority string for profile \"%s\" contains unknown tokens and stripping it didn't yield a working one either, falling back to \"%s\"", profilename.c_str(), stripped.c_str()); } else if ((found) && (stripped != priostr)) { // Prio string was set in the config and we ended up with something that works but different - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Priority string for profile \"%s\" contains unknown tokens, stripped to \"%s\"", profilename.c_str(), stripped.c_str()); + ServerInstance->Logs.Normal(MODNAME, "Priority string for profile \"%s\" contains unknown tokens, stripped to \"%s\"", profilename.c_str(), stripped.c_str()); } priostr.swap(stripped); } @@ -1132,14 +1132,14 @@ class ModuleSSLGnuTLS final { if (!stdalgo::string::equalsci(tag->getString("provider"), "gnutls")) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Ignoring non-GnuTLS <sslprofile> tag at " + tag->source.str()); + ServerInstance->Logs.Normal(MODNAME, "Ignoring non-GnuTLS <sslprofile> tag at " + tag->source.str()); continue; } std::string name = tag->getString("name"); if (name.empty()) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Ignoring <sslprofile> tag without name at " + tag->source.str()); + ServerInstance->Logs.Normal(MODNAME, "Ignoring <sslprofile> tag without name at " + tag->source.str()); continue; } @@ -1174,7 +1174,7 @@ public: void init() override { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "GnuTLS lib version %s module was compiled for " GNUTLS_VERSION, gnutls_check_version(NULL)); + ServerInstance->Logs.Normal(MODNAME, "GnuTLS lib version %s module was compiled for " GNUTLS_VERSION, gnutls_check_version(NULL)); ServerInstance->GenRandom = GnuTLS::GenRandom; } diff --git a/src/modules/extra/m_ssl_mbedtls.cpp b/src/modules/extra/m_ssl_mbedtls.cpp index 8e4f01086..09023771b 100644 --- a/src/modules/extra/m_ssl_mbedtls.cpp +++ b/src/modules/extra/m_ssl_mbedtls.cpp @@ -278,7 +278,7 @@ namespace mbedTLS size_t len = strlen(msg); if ((len > 0) && (msg[len-1] == '\n')) len--; - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "%s:%d %.*s", file, line, len, msg); + ServerInstance->Logs.Debug(MODNAME, "%s:%d %.*s", file, line, len, msg); } #endif @@ -890,14 +890,14 @@ private: { if (!stdalgo::string::equalsci(tag->getString("provider"), "mbedtls")) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Ignoring non-mbedTLS <sslprofile> tag at " + tag->source.str()); + ServerInstance->Logs.Normal(MODNAME, "Ignoring non-mbedTLS <sslprofile> tag at " + tag->source.str()); continue; } std::string name = tag->getString("name"); if (name.empty()) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Ignoring <sslprofile> tag without name at " + tag->source.str()); + ServerInstance->Logs.Normal(MODNAME, "Ignoring <sslprofile> tag without name at " + tag->source.str()); continue; } @@ -934,7 +934,7 @@ public: { char verbuf[16]; // Should be at least 9 bytes in size mbedtls_version_get_string(verbuf); - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "mbedTLS lib version %s module was compiled for " MBEDTLS_VERSION_STRING, verbuf); + ServerInstance->Logs.Normal(MODNAME, "mbedTLS lib version %s module was compiled for " MBEDTLS_VERSION_STRING, verbuf); if (!ctr_drbg.Seed(entropy)) throw ModuleException(this, "CTR DRBG seed failed"); diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index e3b7f350b..5d4876d9e 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -359,9 +359,9 @@ namespace OpenSSL if (!setoptions && !clearoptions) return; // Nothing to do - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Setting %s %s context options, default: %ld set: %ld clear: %ld", name.c_str(), ctxname.c_str(), ctx.GetDefaultContextOptions(), setoptions, clearoptions); + ServerInstance->Logs.Debug(MODNAME, "Setting %s %s context options, default: %ld set: %ld clear: %ld", name.c_str(), ctxname.c_str(), ctx.GetDefaultContextOptions(), setoptions, clearoptions); long final = context.SetRawContextOptions(setoptions, clearoptions); - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "%s %s context options: %ld", name.c_str(), ctxname.c_str(), final); + ServerInstance->Logs.Normal(MODNAME, "%s %s context options: %ld", name.c_str(), ctxname.c_str(), final); } public: @@ -405,7 +405,7 @@ namespace OpenSSL throw Exception("Can't set ciphersuite list to \"" + ciphersuites + "\" " + lasterr); } #else - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "You have configured <sslprofile:ciphersuites> but your version of OpenSSL does not support TLSv1.3+"); + ServerInstance->Logs.Debug(MODNAME, "You have configured <sslprofile:ciphersuites> but your version of OpenSSL does not support TLSv1.3+"); #endif } @@ -440,7 +440,7 @@ namespace OpenSSL if ((!ctx.SetCA(filename)) || (!clientctx.SetCA(filename))) { ERR_print_errors_cb(error_callback, this); - 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", filename.c_str(), lasterr.c_str()); + ServerInstance->Logs.Normal(MODNAME, "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", filename.c_str(), lasterr.c_str()); } // Load the CRLs. @@ -663,7 +663,7 @@ private: if (status != STATUS_NONE) return true; - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Session %p killed, attempted to renegotiate", (void*)sess); + ServerInstance->Logs.Debug(MODNAME, "Session %p killed, attempted to renegotiate", (void*)sess); CloseSession(); sock->SetError("Renegotiation is not allowed"); return false; @@ -959,14 +959,14 @@ class ModuleSSLOpenSSL final { if (!stdalgo::string::equalsci(tag->getString("provider"), "openssl")) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Ignoring non-OpenSSL <sslprofile> tag at " + tag->source.str()); + ServerInstance->Logs.Normal(MODNAME, "Ignoring non-OpenSSL <sslprofile> tag at " + tag->source.str()); continue; } std::string name = tag->getString("name"); if (name.empty()) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Ignoring <sslprofile> tag without name at " + tag->source.str()); + ServerInstance->Logs.Normal(MODNAME, "Ignoring <sslprofile> tag without name at " + tag->source.str()); continue; } @@ -1007,7 +1007,7 @@ public: void init() override { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "OpenSSL lib version \"%s\" module was compiled for \"" OPENSSL_VERSION_TEXT "\"", OpenSSL_version(OPENSSL_VERSION)); + ServerInstance->Logs.Normal(MODNAME, "OpenSSL lib version \"%s\" module was compiled for \"" OPENSSL_VERSION_TEXT "\"", OpenSSL_version(OPENSSL_VERSION)); // Register application specific data char exdatastr[] = "inspircd"; diff --git a/src/modules/extra/m_sslrehashsignal.cpp b/src/modules/extra/m_sslrehashsignal.cpp index 3f90bf86d..41b90d6df 100644 --- a/src/modules/extra/m_sslrehashsignal.cpp +++ b/src/modules/extra/m_sslrehashsignal.cpp @@ -54,7 +54,7 @@ public: const std::string feedbackmsg = "Got SIGUSR1, reloading TLS credentials"; ServerInstance->SNO.WriteGlobalSno('r', feedbackmsg); - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, feedbackmsg); + ServerInstance->Logs.Normal(MODNAME, feedbackmsg); const std::string str = "tls"; FOREACH_MOD(OnModuleRehash, (NULL, str)); diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index de2cee7bc..951d6d81a 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -145,12 +145,12 @@ struct CallerIDExtInfo final callerid_data* target = this->Get(user, false); if (!target) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "ERROR: Inconsistency detected in callerid state, please report (1)"); + ServerInstance->Logs.Normal(MODNAME, "ERROR: Inconsistency detected in callerid state, please report (1)"); continue; // shouldn't happen, but oh well. } if (!stdalgo::vector::swaperase(target->wholistsme, dat)) - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "ERROR: Inconsistency detected in callerid state, please report (2)"); + ServerInstance->Logs.Normal(MODNAME, "ERROR: Inconsistency detected in callerid state, please report (2)"); } delete dat; } @@ -321,12 +321,12 @@ public: if (!dat2) { // How the fuck is this possible. - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "ERROR: Inconsistency detected in callerid state, please report (3)"); + ServerInstance->Logs.Normal(MODNAME, "ERROR: Inconsistency detected in callerid state, please report (3)"); return false; } if (!stdalgo::vector::swaperase(dat2->wholistsme, dat)) - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "ERROR: Inconsistency detected in callerid state, please report (4)"); + ServerInstance->Logs.Normal(MODNAME, "ERROR: Inconsistency detected in callerid state, please report (4)"); user->WriteNotice(whotoremove->nick + " is no longer on your accept list"); return true; @@ -382,7 +382,7 @@ private: { // Find me on their callerid list if (!dat->accepting.erase(who)) - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "ERROR: Inconsistency detected in callerid state, please report (5)"); + ServerInstance->Logs.Normal(MODNAME, "ERROR: Inconsistency detected in callerid state, please report (5)"); } userdata->wholistsme.clear(); diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp index 07033df2b..06522b315 100644 --- a/src/modules/m_cap.cpp +++ b/src/modules/m_cap.cpp @@ -88,7 +88,7 @@ class Cap::ManagerImpl final void OnReloadModuleSave(Module* mod, ReloadModule::CustomData& cd) override { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "OnReloadModuleSave()"); + ServerInstance->Logs.Debug(MODNAME, "OnReloadModuleSave()"); if (mod == creator) return; @@ -101,7 +101,7 @@ class Cap::ManagerImpl final if (cap->creator != mod) continue; - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Module being reloaded implements cap %s, saving cap users", cap->GetName().c_str()); + ServerInstance->Logs.Debug(MODNAME, "Module being reloaded implements cap %s, saving cap users", cap->GetName().c_str()); capmoddata->caps.emplace_back(cap); CapModData::Data& capdata = capmoddata->caps.back(); @@ -122,7 +122,7 @@ class Cap::ManagerImpl final Capability* cap = ManagerImpl::Find(capdata.name); if (!cap) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Cap %s is no longer available after reload", capdata.name.c_str()); + ServerInstance->Logs.Debug(MODNAME, "Cap %s is no longer available after reload", capdata.name.c_str()); continue; } @@ -132,7 +132,7 @@ class Cap::ManagerImpl final User* user = ServerInstance->Users.FindUUID(uuid); if (!user) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "User %s is gone when trying to restore cap %s", uuid.c_str(), capdata.name.c_str()); + ServerInstance->Logs.Debug(MODNAME, "User %s is gone when trying to restore cap %s", uuid.c_str(), capdata.name.c_str()); continue; } @@ -165,7 +165,7 @@ public: if (cap->IsRegistered()) return; - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Registering cap %s", cap->GetName().c_str()); + ServerInstance->Logs.Debug(MODNAME, "Registering cap %s", cap->GetName().c_str()); cap->bit = AllocateBit(); cap->extitem = &capext; caps.emplace(cap->GetName(), cap); @@ -180,7 +180,7 @@ public: if (!cap->IsRegistered()) return; - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Unregistering cap %s", cap->GetName().c_str()); + ServerInstance->Logs.Debug(MODNAME, "Unregistering cap %s", cap->GetName().c_str()); // Fire the event first so modules can still see who is using the cap which is being unregistered evprov.Call(&Cap::EventListener::OnCapAddDel, cap, false); @@ -204,7 +204,7 @@ public: void NotifyValueChange(Capability* cap) override { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Cap %s changed value", cap->GetName().c_str()); + ServerInstance->Logs.Debug(MODNAME, "Cap %s changed value", cap->GetName().c_str()); evprov.Call(&Cap::EventListener::OnCapValueChange, cap); } diff --git a/src/modules/m_chanlog.cpp b/src/modules/m_chanlog.cpp index 70af05bf5..fc4611faf 100644 --- a/src/modules/m_chanlog.cpp +++ b/src/modules/m_chanlog.cpp @@ -58,7 +58,7 @@ public: for (const auto& snomask : snomasks) { newlogs.emplace(snomask, channel); - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Logging %c to %s", snomask, channel.c_str()); + ServerInstance->Logs.Normal(MODNAME, "Logging %c to %s", snomask, channel.c_str()); } } logstreams.swap(newlogs); diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 828262ed0..c78712839 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -166,7 +166,7 @@ public: } catch (CoreException& modexcept) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Exception caught when generating cloak: " + modexcept.GetReason()); + ServerInstance->Logs.Normal(MODNAME, "Exception caught when generating cloak: " + modexcept.GetReason()); return MODEACTION_DENY; } } diff --git a/src/modules/m_codepage.cpp b/src/modules/m_codepage.cpp index df447a930..90d771e78 100644 --- a/src/modules/m_codepage.cpp +++ b/src/modules/m_codepage.cpp @@ -282,7 +282,7 @@ public: switch (newcodepage->AllowCharacter(static_cast<uint32_t>(pos), front)) { case Codepage::ACR_OKAY: - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Marked %lu (%.4s) as allowed (front: %s)", + ServerInstance->Logs.Debug(MODNAME, "Marked %lu (%.4s) as allowed (front: %s)", pos, reinterpret_cast<unsigned char*>(&pos), front ? "yes" : "no"); break; @@ -310,7 +310,7 @@ public: if (!newcodepage->Map(upper, lower)) throw ModuleException(this, "Malformed <cpcase> tag at " + tag->source.str()); - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Marked %lu (%.4s) as the lower case version of %lu (%.4s)", + ServerInstance->Logs.Debug(MODNAME, "Marked %lu (%.4s) as the lower case version of %lu (%.4s)", lower, reinterpret_cast<unsigned char*>(&lower), upper, reinterpret_cast<unsigned char*>(&upper)); } diff --git a/src/modules/m_connectban.cpp b/src/modules/m_connectban.cpp index 0b279adf4..e074c9cc7 100644 --- a/src/modules/m_connectban.cpp +++ b/src/modules/m_connectban.cpp @@ -64,7 +64,7 @@ private: } // If we have reached this point then we have encountered a bug. - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "BUG: ModuleConnectBan::GetRange(): socket type %d is unknown!", family); + ServerInstance->Logs.Debug(MODNAME, "BUG: ModuleConnectBan::GetRange(): socket type %d is unknown!", family); return 0; } @@ -170,7 +170,7 @@ public: void OnGarbageCollect() override { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Clearing map."); + ServerInstance->Logs.Debug(MODNAME, "Clearing map."); connects.clear(); } }; diff --git a/src/modules/m_customprefix.cpp b/src/modules/m_customprefix.cpp index 74abde099..093f8a9e0 100644 --- a/src/modules/m_customprefix.cpp +++ b/src/modules/m_customprefix.cpp @@ -38,7 +38,7 @@ public: bool depriv = tag->getBool("depriv", true); this->Update(rank, setrank, unsetrank, depriv); - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Created the %s prefix: letter=%c prefix=%c rank=%u ranktoset=%u ranktounset=%i depriv=%d", + ServerInstance->Logs.Debug(MODNAME, "Created the %s prefix: letter=%c prefix=%c rank=%u ranktoset=%u ranktounset=%i depriv=%d", name.c_str(), GetModeChar(), GetPrefix(), GetPrefixRank(), GetLevelRequired(true), GetLevelRequired(false), CanSelfRemove()); } }; @@ -82,7 +82,7 @@ public: bool depriv = tag->getBool("depriv", pm->CanSelfRemove()); pm->Update(rank, setrank, unsetrank, depriv); - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Changed the %s prefix: depriv=%u rank=%u ranktoset=%u ranktounset=%u", + ServerInstance->Logs.Debug(MODNAME, "Changed the %s prefix: depriv=%u rank=%u ranktoset=%u ranktounset=%u", pm->name.c_str(), pm->CanSelfRemove(), pm->GetPrefixRank(), pm->GetLevelRequired(true), pm->GetLevelRequired(false)); continue; } diff --git a/src/modules/m_customtitle.cpp b/src/modules/m_customtitle.cpp index a27a1d2d0..bfd2f420e 100644 --- a/src/modules/m_customtitle.cpp +++ b/src/modules/m_customtitle.cpp @@ -127,7 +127,7 @@ public: const std::string hash = tag->getString("hash", "plaintext", 1); if (stdalgo::string::equalsci(hash, "plaintext")) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "<title> tag for %s at %s contains an plain text password, this is insecure!", + ServerInstance->Logs.Normal(MODNAME, "<title> tag for %s at %s contains an plain text password, this is insecure!", name.c_str(), tag->source.str().c_str()); } diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index bffa96872..31032d81b 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -135,7 +135,7 @@ public: // Check we have space for another entry. if (list->size() >= maxentries) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Oversized DCC allow list received for %s: %s", + ServerInstance->Logs.Debug(MODNAME, "Oversized DCC allow list received for %s: %s", user->uuid.c_str(), value.c_str()); delete list; return; @@ -148,7 +148,7 @@ public: !ts.GetNumericToken(dccallow.set_on) || !ts.GetNumericToken(dccallow.length)) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Malformed DCC allow list received for %s: %s", + ServerInstance->Logs.Debug(MODNAME, "Malformed DCC allow list received for %s: %s", user->uuid.c_str(), value.c_str()); delete list; return; diff --git a/src/modules/m_disable.cpp b/src/modules/m_disable.cpp index 1e77a609b..774ecb278 100644 --- a/src/modules/m_disable.cpp +++ b/src/modules/m_disable.cpp @@ -58,7 +58,7 @@ private: chr, field.c_str(), tag->source.str().c_str())); // Disable the mode. - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "The %c (%s) %s mode has been disabled", + ServerInstance->Logs.Debug(MODNAME, "The %c (%s) %s mode has been disabled", mh->GetModeChar(), mh->name.c_str(), type == MODETYPE_CHANNEL ? "channel" : "user"); status.set(ModeParser::GetModeIndex(chr)); } @@ -72,7 +72,7 @@ private: if (notifyopers) ServerInstance->SNO.WriteToSnoMask('a', buffer); else - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, buffer); + ServerInstance->Logs.Normal(MODNAME, buffer); } public: @@ -101,7 +101,7 @@ public: continue; // Disable the command. - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "The %s command has been disabled", handler->name.c_str()); + ServerInstance->Logs.Debug(MODNAME, "The %s command has been disabled", handler->name.c_str()); newcommands.push_back(handler->name); } diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index fb5ee30ff..cbeac201b 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -437,7 +437,7 @@ public: else return; - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Reversed IP %s -> %s", user->GetIPString().c_str(), reversedip.c_str()); + ServerInstance->Logs.Debug(MODNAME, "Reversed IP %s -> %s", user->GetIPString().c_str(), reversedip.c_str()); countExt.Set(user, dnsbls.size()); @@ -456,7 +456,7 @@ public: catch (const DNS::Exception& ex) { delete r; - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, ex.GetReason()); + ServerInstance->Logs.Debug(MODNAME, ex.GetReason()); } if (user->quitting) @@ -473,14 +473,14 @@ public: std::string* match = nameExt.Get(user); if (!match) { - ServerInstance->Logs.Log("CONNECTCLASS", LOG_DEBUG, "The %s connect class is not suitable as it requires a DNSBL mark", + ServerInstance->Logs.Debug("CONNECTCLASS", "The %s connect class is not suitable as it requires a DNSBL mark", myclass->GetName().c_str()); return MOD_RES_DENY; } if (!InspIRCd::Match(*match, dnsbl)) { - ServerInstance->Logs.Log("CONNECTCLASS", LOG_DEBUG, "The %s connect class is not suitable as the DNSBL mark (%s) does not match %s", + ServerInstance->Logs.Debug("CONNECTCLASS", "The %s connect class is not suitable as the DNSBL mark (%s) does not match %s", myclass->GetName().c_str(), match->c_str(), dnsbl.c_str()); return MOD_RES_DENY; } diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index 2f3474461..ba8845cfe 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -504,7 +504,7 @@ ModResult ModuleFilter::OnUserPreMessage(User* user, const MessageTarget& msgtar delete zl; } - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, user->nick + " had their message filtered, target was " + msgtarget.GetName() + ": " + f->reason + " Action: " + ModuleFilter::FilterActionToString(f->action)); + ServerInstance->Logs.Normal(MODNAME, user->nick + " had their message filtered, target was " + msgtarget.GetName() + ": " + f->reason + " Action: " + ModuleFilter::FilterActionToString(f->action)); return MOD_RES_DENY; } return MOD_RES_PASSTHRU; @@ -749,7 +749,7 @@ void ModuleFilter::OnDecodeMetaData(Extensible* target, const std::string &extna } catch (const ModuleException& e) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Error when unserializing filter: " + e.GetReason()); + ServerInstance->Logs.Debug(MODNAME, "Error when unserializing filter: " + e.GetReason()); } } } @@ -809,7 +809,7 @@ std::pair<bool, std::string> ModuleFilter::AddFilter(const std::string& freeform } catch (const ModuleException& e) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Error in regular expression '%s': %s", freeform.c_str(), e.GetReason().c_str()); + ServerInstance->Logs.Normal(MODNAME, "Error in regular expression '%s': %s", freeform.c_str(), e.GetReason().c_str()); return std::make_pair(false, e.GetReason()); } return std::make_pair(true, ""); @@ -888,7 +888,7 @@ void ModuleFilter::ReadFilters() if (result.first) removedfilters.erase(pattern); else - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Filter '%s' could not be added: %s", pattern.c_str(), result.second.c_str()); + ServerInstance->Logs.Normal(MODNAME, "Filter '%s' could not be added: %s", pattern.c_str(), result.second.c_str()); } if (!removedfilters.empty()) diff --git a/src/modules/m_gateway.cpp b/src/modules/m_gateway.cpp index 32d9c0ca3..15e827507 100644 --- a/src/modules/m_gateway.cpp +++ b/src/modules/m_gateway.cpp @@ -392,7 +392,7 @@ public: if (!password.empty() && stdalgo::string::equalsci(passwordhash, "plaintext")) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "<%s> tag at %s contains an plain text password, this is insecure!", + ServerInstance->Logs.Normal(MODNAME, "<%s> tag at %s contains an plain text password, this is insecure!", tag->name.c_str(), tag->source.str().c_str()); } @@ -421,7 +421,7 @@ public: const std::string* gateway = cmdwebirc.extban.gateway.Get(user); if (!gateway) { - ServerInstance->Logs.Log("CONNECTCLASS", LOG_DEBUG, "The %s connect class is not suitable as it requires a connection via a WebIRC gateway", + ServerInstance->Logs.Debug("CONNECTCLASS", "The %s connect class is not suitable as it requires a connection via a WebIRC gateway", myclass->GetName().c_str()); return MOD_RES_DENY; } @@ -430,7 +430,7 @@ public: // allow the check to continue. Otherwise, reject it. if (!InspIRCd::Match(*gateway, webirc)) { - ServerInstance->Logs.Log("CONNECTCLASS", LOG_DEBUG, "The %s connect class is not suitable as the WebIRC gateway name (%s) does not match %s", + ServerInstance->Logs.Debug("CONNECTCLASS", "The %s connect class is not suitable as the WebIRC gateway name (%s) does not match %s", myclass->GetName().c_str(), gateway->c_str(), webirc.c_str()); return MOD_RES_DENY; } @@ -497,7 +497,7 @@ public: default: // If we have reached this point then we have encountered a bug. - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "BUG: OnWebIRCAuth(%s): socket type %d is unknown!", + ServerInstance->Logs.Debug(MODNAME, "BUG: OnWebIRCAuth(%s): socket type %d is unknown!", user->uuid.c_str(), user->client_sa.family()); return; } @@ -523,7 +523,7 @@ public: default: // If we have reached this point then we have encountered a bug. - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "BUG: OnWebIRCAuth(%s): socket type %d is unknown!", + ServerInstance->Logs.Debug(MODNAME, "BUG: OnWebIRCAuth(%s): socket type %d is unknown!", user->uuid.c_str(), user->server_sa.family()); return; } diff --git a/src/modules/m_geoclass.cpp b/src/modules/m_geoclass.cpp index f962750d3..4a0e53830 100644 --- a/src/modules/m_geoclass.cpp +++ b/src/modules/m_geoclass.cpp @@ -58,7 +58,7 @@ public: // A list of country codes were specified but the user didn't match // any of them. - ServerInstance->Logs.Log("CONNECTCLASS", LOG_DEBUG, "The %s connect class is not suitable as the origin country (%s) is not any of %s", + ServerInstance->Logs.Debug("CONNECTCLASS", "The %s connect class is not suitable as the origin country (%s) is not any of %s", myclass->GetName().c_str(), code.c_str(), country.c_str()); return MOD_RES_DENY; } diff --git a/src/modules/m_hidemode.cpp b/src/modules/m_hidemode.cpp index 4c1200e96..56acdd01e 100644 --- a/src/modules/m_hidemode.cpp +++ b/src/modules/m_hidemode.cpp @@ -52,7 +52,7 @@ public: if (!rank) throw ModuleException(mod, "<hidemode:rank> must be greater than 0 at " + tag->source.str()); - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Hiding the %s mode from users below rank %lu", modename.c_str(), rank); + ServerInstance->Logs.Debug(MODNAME, "Hiding the %s mode from users below rank %lu", modename.c_str(), rank); newranks.emplace(modename, rank); } rankstosee.swap(newranks); diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index 8bce18626..b6d919c05 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -82,7 +82,7 @@ private: { if (!messagecomplete) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "HTTP socket %d timed out", GetFd()); + ServerInstance->Logs.Debug(MODNAME, "HTTP socket %d timed out", GetFd()); Close(); return false; } @@ -216,7 +216,7 @@ public: // IOHook may have errored if (!GetError().empty()) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "HTTP socket %d encountered a hook error: %s", + ServerInstance->Logs.Debug(MODNAME, "HTTP socket %d encountered a hook error: %s", GetFd(), GetError().c_str()); Close(); return; @@ -245,7 +245,7 @@ public: void OnError(BufferedSocketError err) override { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "HTTP socket %d encountered an error: %d - %s", + ServerInstance->Logs.Debug(MODNAME, "HTTP socket %d encountered an error: %d - %s", GetFd(), err, GetError().c_str()); Close(); } @@ -255,7 +255,7 @@ public: if (!errstr) errstr = http_status_str((http_status)response); - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Sending HTTP error %u: %s", response, errstr); + ServerInstance->Logs.Debug(MODNAME, "Sending HTTP error %u: %s", response, errstr); static HTTPHeaders empty; std::string data = InspIRCd::Format( "<html><head></head><body style='font-family: sans-serif; text-align: center'>" diff --git a/src/modules/m_httpd_acl.cpp b/src/modules/m_httpd_acl.cpp index a9ca979ef..66f6f8bb2 100644 --- a/src/modules/m_httpd_acl.cpp +++ b/src/modules/m_httpd_acl.cpp @@ -92,7 +92,7 @@ public: } } - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Read ACL: path=%s pass=%s whitelist=%s blacklist=%s", path.c_str(), + ServerInstance->Logs.Debug(MODNAME, "Read ACL: path=%s pass=%s whitelist=%s blacklist=%s", path.c_str(), password.c_str(), whitelist.c_str(), blacklist.c_str()); new_acls.emplace_back(path, username, password, whitelist, blacklist); @@ -102,7 +102,7 @@ public: void BlockAccess(HTTPRequest* http, unsigned int returnval, const std::string &extraheaderkey = "", const std::string &extraheaderval="") { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "BlockAccess (%u)", returnval); + ServerInstance->Logs.Debug(MODNAME, "BlockAccess (%u)", returnval); std::stringstream data; data << "<html><head></head><body style='font-family: sans-serif; text-align: center'>" @@ -121,7 +121,7 @@ public: bool IsAccessAllowed(HTTPRequest* http) { { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Handling httpd acl event"); + ServerInstance->Logs.Debug(MODNAME, "Handling httpd acl event"); for (const auto& acl : acl_list) { @@ -137,7 +137,7 @@ public: { if (InspIRCd::Match(http->GetIP(), entry, ascii_case_insensitive_map)) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Denying access to blacklisted resource %s (matched by pattern %s) from ip %s (matched by entry %s)", + ServerInstance->Logs.Debug(MODNAME, "Denying access to blacklisted resource %s (matched by pattern %s) from ip %s (matched by entry %s)", http->GetPath().c_str(), acl.path.c_str(), http->GetIP().c_str(), entry.c_str()); BlockAccess(http, 403); return false; @@ -159,7 +159,7 @@ public: if (!allow_access) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Denying access to whitelisted resource %s (matched by pattern %s) from ip %s (Not in whitelist)", + ServerInstance->Logs.Debug(MODNAME, "Denying access to whitelisted resource %s (matched by pattern %s) from ip %s (Not in whitelist)", http->GetPath().c_str(), acl.path.c_str(), http->GetIP().c_str()); BlockAccess(http, 403); return false; @@ -168,7 +168,7 @@ public: if (!acl.password.empty() && !acl.username.empty()) { /* Password auth, first look to see if we have a basic authentication header */ - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Checking HTTP auth password for resource %s (matched by pattern %s) from ip %s, against username %s", + ServerInstance->Logs.Debug(MODNAME, "Checking HTTP auth password for resource %s (matched by pattern %s) from ip %s, against username %s", http->GetPath().c_str(), acl.path.c_str(), http->GetIP().c_str(), acl.username.c_str()); if (http->headers->IsSet("Authorization")) @@ -187,7 +187,7 @@ public: sep.GetToken(base64); std::string userpass = Base64::Decode(base64); - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "HTTP authorization: %s (%s)", userpass.c_str(), base64.c_str()); + ServerInstance->Logs.Debug(MODNAME, "HTTP authorization: %s (%s)", userpass.c_str(), base64.c_str()); irc::sepstream userpasspair(userpass, ':'); if (userpasspair.GetToken(user)) @@ -197,34 +197,34 @@ public: /* Access granted if username and password are correct */ if (InspIRCd::TimingSafeCompare(user, acl.username) && InspIRCd::TimingSafeCompare(pass, acl.password)) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "HTTP authorization: password and username match"); + ServerInstance->Logs.Debug(MODNAME, "HTTP authorization: password and username match"); return true; } else { /* Invalid password */ - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "HTTP authorization: password and username do not match"); + ServerInstance->Logs.Debug(MODNAME, "HTTP authorization: password and username do not match"); BlockAccess(http, 401, "WWW-Authenticate", "Basic realm=\"Restricted Object\""); } } else { /* Malformed user:pass pair */ - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "HTTP authorization: password and username malformed"); + ServerInstance->Logs.Debug(MODNAME, "HTTP authorization: password and username malformed"); BlockAccess(http, 401, "WWW-Authenticate", "Basic realm=\"Restricted Object\""); } } else { /* Unsupported authentication type */ - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "HTTP authorization: unsupported auth type: %s", authtype.c_str()); + ServerInstance->Logs.Debug(MODNAME, "HTTP authorization: unsupported auth type: %s", authtype.c_str()); BlockAccess(http, 401, "WWW-Authenticate", "Basic realm=\"Restricted Object\""); } } else { /* No password given at all, access denied */ - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "HTTP authorization: password and username not sent"); + ServerInstance->Logs.Debug(MODNAME, "HTTP authorization: password and username not sent"); BlockAccess(http, 401, "WWW-Authenticate", "Basic realm=\"Restricted Object\""); } return false; diff --git a/src/modules/m_httpd_config.cpp b/src/modules/m_httpd_config.cpp index a921aebc2..986eb6b85 100644 --- a/src/modules/m_httpd_config.cpp +++ b/src/modules/m_httpd_config.cpp @@ -45,7 +45,7 @@ public: if (request.GetPath() != "/config") return MOD_RES_PASSTHRU; - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Handling HTTP request for %s", request.GetPath().c_str()); + ServerInstance->Logs.Debug(MODNAME, "Handling HTTP request for %s", request.GetPath().c_str()); std::stringstream buffer; for (const auto& [_, tag] : ServerInstance->Config->config_data) diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index be98767c8..91bfba6ca 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -408,7 +408,7 @@ public: if (http->GetPath().compare(0, 6, "/stats")) return MOD_RES_PASSTHRU; - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Handling HTTP request for %s", http->GetPath().c_str()); + ServerInstance->Logs.Debug(MODNAME, "Handling HTTP request for %s", http->GetPath().c_str()); bool found = true; std::stringstream data; diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index fa4b44930..7a943ca7c 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -190,7 +190,7 @@ public: */ if (HasFd()) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Close ident socket %d", GetFd()); + ServerInstance->Logs.Debug(MODNAME, "Close ident socket %d", GetFd()); SocketEngine::Close(this); } } @@ -220,7 +220,7 @@ public: if (recvresult < 3) return; - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "ReadResponse()"); + ServerInstance->Logs.Debug(MODNAME, "ReadResponse()"); /* Truncate at the first null character, but first make sure * there is at least one null char (at the end of the buffer). @@ -349,7 +349,7 @@ public: } catch (const ModuleException& e) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Ident exception: " + e.GetReason()); + ServerInstance->Logs.Debug(MODNAME, "Ident exception: " + e.GetReason()); } } @@ -410,7 +410,7 @@ public: { if (myclass->config->getBool("requireident") && state.Get(user) != IDENT_FOUND) { - ServerInstance->Logs.Log("CONNECTCLASS", LOG_DEBUG, "The %s connect class is not suitable as it requires an identd response", + ServerInstance->Logs.Debug("CONNECTCLASS", "The %s connect class is not suitable as it requires an identd response", myclass->GetName().c_str()); return MOD_RES_DENY; } diff --git a/src/modules/m_ircv3_sts.cpp b/src/modules/m_ircv3_sts.cpp index cbfb45464..d2823f895 100644 --- a/src/modules/m_ircv3_sts.cpp +++ b/src/modules/m_ircv3_sts.cpp @@ -100,21 +100,21 @@ public: bool changed = false; if (!irc::equals(host, newhost)) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Changing STS SNI hostname from \"%s\" to \"%s\"", host.c_str(), newhost.c_str()); + ServerInstance->Logs.Debug(MODNAME, "Changing STS SNI hostname from \"%s\" to \"%s\"", host.c_str(), newhost.c_str()); host = newhost; changed = true; } if (plaintextpolicy != newplaintextpolicy) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Changing plaintext STS policy from \"%s\" to \"%s\"", plaintextpolicy.c_str(), newplaintextpolicy.c_str()); + ServerInstance->Logs.Debug(MODNAME, "Changing plaintext STS policy from \"%s\" to \"%s\"", plaintextpolicy.c_str(), newplaintextpolicy.c_str()); plaintextpolicy.swap(newplaintextpolicy); changed = true; } if (securepolicy != newsecurepolicy) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Changing secure STS policy from \"%s\" to \"%s\"", securepolicy.c_str(), newsecurepolicy.c_str()); + ServerInstance->Logs.Debug(MODNAME, "Changing secure STS policy from \"%s\" to \"%s\"", securepolicy.c_str(), newsecurepolicy.c_str()); securepolicy.swap(newsecurepolicy); changed = true; } diff --git a/src/modules/m_ldapauth.cpp b/src/modules/m_ldapauth.cpp index 7d38250bd..00eb4f518 100644 --- a/src/modules/m_ldapauth.cpp +++ b/src/modules/m_ldapauth.cpp @@ -161,7 +161,7 @@ public: for (const auto& [attr, val] : requiredattributes) { // Note that only one of these has to match for it to be success - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "LDAP compare: %s=%s", attr.c_str(), val.c_str()); + ServerInstance->Logs.Debug(MODNAME, "LDAP compare: %s=%s", attr.c_str(), val.c_str()); try { LDAP->Compare(this, DN, attr, val); diff --git a/src/modules/m_operlog.cpp b/src/modules/m_operlog.cpp index 3d1ea889a..ff2f15768 100644 --- a/src/modules/m_operlog.cpp +++ b/src/modules/m_operlog.cpp @@ -58,7 +58,7 @@ public: if (tosnomask) ServerInstance->SNO.WriteGlobalSno('o', msg); else - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, msg); + ServerInstance->Logs.Normal(MODNAME, msg); } } diff --git a/src/modules/m_password_hash.cpp b/src/modules/m_password_hash.cpp index fcb1a9f2b..d7f9002a1 100644 --- a/src/modules/m_password_hash.cpp +++ b/src/modules/m_password_hash.cpp @@ -114,7 +114,7 @@ public: if (hp->IsKDF()) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Tried to use HMAC with %s, which does not support HMAC", type.c_str()); + ServerInstance->Logs.Normal(MODNAME, "Tried to use HMAC with %s, which does not support HMAC", type.c_str()); return MOD_RES_DENY; } diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index cbc6097a2..24f467ac8 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.cpp @@ -77,7 +77,7 @@ static bool WriteDatabase(PermChannel& permchanmode, Module* mod, bool save_list std::ofstream stream(permchannelsnewconf); if (!stream.is_open()) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Cannot create database \"%s\"! %s (%d)", permchannelsnewconf.c_str(), strerror(errno), errno); + ServerInstance->Logs.Normal(MODNAME, "Cannot create database \"%s\"! %s (%d)", permchannelsnewconf.c_str(), strerror(errno), errno); ServerInstance->SNO.WriteToSnoMask('a', "database: cannot create new permchan db \"%s\": %s (%d)", permchannelsnewconf.c_str(), strerror(errno), errno); return false; } @@ -145,7 +145,7 @@ static bool WriteDatabase(PermChannel& permchanmode, Module* mod, bool save_list if (stream.fail()) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Cannot write to new database \"%s\"! %s (%d)", permchannelsnewconf.c_str(), strerror(errno), errno); + ServerInstance->Logs.Normal(MODNAME, "Cannot write to new database \"%s\"! %s (%d)", permchannelsnewconf.c_str(), strerror(errno), errno); ServerInstance->SNO.WriteToSnoMask('a', "database: cannot write to new permchan db \"%s\": %s (%d)", permchannelsnewconf.c_str(), strerror(errno), errno); return false; } @@ -157,7 +157,7 @@ static bool WriteDatabase(PermChannel& permchanmode, Module* mod, bool save_list // Use rename to move temporary to new db - this is guaranteed 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, "Cannot replace old database \"%s\" with new database \"%s\"! %s (%d)", permchannelsconf.c_str(), permchannelsnewconf.c_str(), strerror(errno), errno); + ServerInstance->Logs.Normal(MODNAME, "Cannot replace old database \"%s\" with new database \"%s\"! %s (%d)", permchannelsconf.c_str(), permchannelsnewconf.c_str(), strerror(errno), errno); ServerInstance->SNO.WriteToSnoMask('a', "database: cannot replace old permchan db \"%s\" with new db \"%s\": %s (%d)", permchannelsconf.c_str(), permchannelsnewconf.c_str(), strerror(errno), errno); return false; } @@ -207,7 +207,7 @@ public: if (!ServerInstance->Channels.IsChannel(channel)) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Ignoring permchannels tag with invalid channel name (\"" + channel + "\")"); + ServerInstance->Logs.Normal(MODNAME, "Ignoring permchannels tag with invalid channel name (\"" + channel + "\")"); continue; } @@ -230,7 +230,7 @@ public: c->SetTopic(ServerInstance->FakeClient, topic, topicset, &topicsetby); } - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Added %s with topic %s", channel.c_str(), c->topic.c_str()); + ServerInstance->Logs.Debug(MODNAME, "Added %s with topic %s", channel.c_str(), c->topic.c_str()); std::string modes = tag->getString("modes"); if (modes.empty()) @@ -313,7 +313,7 @@ public: } catch (CoreException& e) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Error loading permchannels database: " + std::string(e.GetReason())); + ServerInstance->Logs.Normal(MODNAME, "Error loading permchannels database: " + std::string(e.GetReason())); } } } diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index eb7cfe739..2100080dd 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -57,7 +57,7 @@ private: if (InspIRCd::Match(server->GetName(), sasl_target)) { - ServerInstance->Logs.Log(MODNAME, LOG_VERBOSE, "SASL target server \"%s\" %s", sasl_target.c_str(), (linked ? "came online" : "went offline")); + ServerInstance->Logs.Normal(MODNAME, "SASL target server \"%s\" %s", sasl_target.c_str(), (linked ? "came online" : "went offline")); online = linked; } } @@ -257,7 +257,7 @@ public: else if (msg[2] == "M") this->user->WriteNumeric(RPL_SASLMECHS, msg[3], "are available SASL mechanisms"); else - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Services sent an unknown SASL message \"%s\" \"%s\"", msg[2].c_str(), msg[3].c_str()); + ServerInstance->Logs.Normal(MODNAME, "Services sent an unknown SASL message \"%s\" \"%s\"", msg[2].c_str(), msg[3].c_str()); break; case SASL_DONE: @@ -376,7 +376,7 @@ public: User* target = ServerInstance->Users.FindUUID(parameters[1]); if (!target) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "User not found in sasl ENCAP event: %s", parameters[1].c_str()); + ServerInstance->Logs.Debug(MODNAME, "User not found in sasl ENCAP event: %s", parameters[1].c_str()); return CmdResult::FAILURE; } @@ -426,7 +426,7 @@ public: void init() override { if (!ServerInstance->Modules.Find("services_account") || !ServerInstance->Modules.Find("cap")) - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "WARNING: m_services_account and m_cap are not loaded! m_sasl will NOT function correctly until these two modules are loaded!"); + ServerInstance->Logs.Normal(MODNAME, "WARNING: m_services_account and m_cap are not loaded! m_sasl will NOT function correctly until these two modules are loaded!"); } void ReadConfig(ConfigStatus& status) override diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index 4ad6c1721..7475ad48d 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -310,7 +310,7 @@ public: { if (myclass->config->getBool("requireaccount") && !accountname.Get(user)) { - ServerInstance->Logs.Log("CONNECTCLASS", LOG_DEBUG, "The %s connect class is not suitable as it requires the user to be logged into an account", + ServerInstance->Logs.Debug("CONNECTCLASS", "The %s connect class is not suitable as it requires the user to be logged into an account", myclass->GetName().c_str()); return MOD_RES_DENY; } diff --git a/src/modules/m_showfile.cpp b/src/modules/m_showfile.cpp index d2f380809..48fab7a2d 100644 --- a/src/modules/m_showfile.cpp +++ b/src/modules/m_showfile.cpp @@ -159,7 +159,7 @@ public: } catch (CoreException& ex) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Error: " + ex.GetReason() + " at " + tag->source.str()); + ServerInstance->Logs.Normal(MODNAME, "Error: " + ex.GetReason() + " at " + tag->source.str()); } } diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index dc26ce4b6..77a5d6ec1 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -214,7 +214,7 @@ public: // Check we have space for another entry. if (list->size() >= maxsilence) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Oversized silence list received for %s: %s", + ServerInstance->Logs.Debug(MODNAME, "Oversized silence list received for %s: %s", user->uuid.c_str(), value.c_str()); delete list; return; @@ -225,7 +225,7 @@ public: std::string flagstr; if (!ts.GetToken(mask) || !ts.GetToken(flagstr)) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Malformed silence list received for %s: %s", + ServerInstance->Logs.Debug(MODNAME, "Malformed silence list received for %s: %s", user->uuid.c_str(), value.c_str()); delete list; return; @@ -235,7 +235,7 @@ public: uint32_t flags; if (!SilenceEntry::FlagsToBits(flagstr, flags)) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Malformed silence flags received for %s: %s", + ServerInstance->Logs.Debug(MODNAME, "Malformed silence flags received for %s: %s", user->uuid.c_str(), flagstr.c_str()); delete list; return; diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp index 47b6497a8..e5470d9c2 100644 --- a/src/modules/m_spanningtree/fjoin.cpp +++ b/src/modules/m_spanningtree/fjoin.cpp @@ -130,7 +130,7 @@ CmdResult CommandFJoin::Handle(User* srcuser, Params& params) time_t ourTS = chan->age; if (TS != ourTS) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Merge FJOIN received for %s, ourTS: %lu, TS: %lu, difference: %ld", + ServerInstance->Logs.Debug(MODNAME, "Merge FJOIN received for %s, ourTS: %lu, TS: %lu, difference: %ld", chan->name.c_str(), (unsigned long)ourTS, (unsigned long)TS, (long)(ourTS - TS)); /* If our TS is less than theirs, we dont accept their modes */ if (ourTS < TS) @@ -140,7 +140,7 @@ CmdResult CommandFJoin::Handle(User* srcuser, Params& params) // Servers behind us won't react this way because the forwarded FJOIN will have the correct TS. if (!sourceserver->IsBursting()) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Server %s recreated channel %s with higher TS, resyncing", sourceserver->GetName().c_str(), chan->name.c_str()); + ServerInstance->Logs.Debug(MODNAME, "Server %s recreated channel %s with higher TS, resyncing", sourceserver->GetName().c_str(), chan->name.c_str()); sourceserver->GetSocket()->SyncChannel(chan); } apply_other_sides_modes = false; diff --git a/src/modules/m_spanningtree/hmac.cpp b/src/modules/m_spanningtree/hmac.cpp index c97e9a49b..eac406184 100644 --- a/src/modules/m_spanningtree/hmac.cpp +++ b/src/modules/m_spanningtree/hmac.cpp @@ -65,7 +65,7 @@ std::string TreeSocket::MakePass(const std::string &password, const std::string return "AUTH:" + Base64::Encode(sha256->hmac(password, challenge)); if (!challenge.empty() && !sha256) - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Not authenticating to server using SHA256/HMAC because we don't have an SHA256 provider (e.g. the sha2 module) loaded!"); + ServerInstance->Logs.Normal(MODNAME, "Not authenticating to server using SHA256/HMAC because we don't have an SHA256 provider (e.g. the sha2 module) loaded!"); return password; } diff --git a/src/modules/m_spanningtree/ijoin.cpp b/src/modules/m_spanningtree/ijoin.cpp index 38d5edebe..1e756b115 100644 --- a/src/modules/m_spanningtree/ijoin.cpp +++ b/src/modules/m_spanningtree/ijoin.cpp @@ -32,7 +32,7 @@ CmdResult CommandIJoin::HandleRemote(RemoteUser* user, Params& params) { // Desync detected, recover // Ignore the join and send RESYNC, this will result in the remote server sending all channel data to us - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Received IJOIN for nonexistent channel: " + params[0]); + ServerInstance->Logs.Debug(MODNAME, "Received IJOIN for nonexistent channel: " + params[0]); CmdBuilder("RESYNC").push(params[0]).Unicast(user); @@ -59,12 +59,12 @@ CmdResult CommandIJoin::HandleRemote(RemoteUser* user, Params& params) CmdResult CommandResync::HandleServer(TreeServer* server, CommandBase::Params& params) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Resyncing " + params[0]); + ServerInstance->Logs.Debug(MODNAME, "Resyncing " + params[0]); Channel* chan = ServerInstance->Channels.Find(params[0]); if (!chan) { // This can happen for a number of reasons, safe to ignore - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Channel does not exist"); + ServerInstance->Logs.Debug(MODNAME, "Channel does not exist"); return CmdResult::FAILURE; } diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index cc41d434e..466cd8b93 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -627,7 +627,7 @@ void ModuleSpanningTree::OnUserPostNick(User* user, const std::string &oldnick) } else if (!loopCall) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "WARNING: Changed nick of remote user %s from %s to %s TS %lu by ourselves!", user->uuid.c_str(), oldnick.c_str(), user->nick.c_str(), (unsigned long) user->age); + ServerInstance->Logs.Normal(MODNAME, "WARNING: Changed nick of remote user %s from %s to %s TS %lu by ourselves!", user->uuid.c_str(), oldnick.c_str(), user->nick.c_str(), (unsigned long) user->age); } } @@ -648,7 +648,7 @@ void ModuleSpanningTree::OnUserKick(User* source, Membership* memb, const std::s void ModuleSpanningTree::OnPreRehash(User* user, const std::string ¶meter) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "OnPreRehash called with param %s", parameter.c_str()); + ServerInstance->Logs.Debug(MODNAME, "OnPreRehash called with param %s", parameter.c_str()); // Send out to other servers if (!parameter.empty() && parameter[0] != '-') diff --git a/src/modules/m_spanningtree/nickcollide.cpp b/src/modules/m_spanningtree/nickcollide.cpp index c98e8ed4a..b0e079de0 100644 --- a/src/modules/m_spanningtree/nickcollide.cpp +++ b/src/modules/m_spanningtree/nickcollide.cpp @@ -90,7 +90,7 @@ bool SpanningTreeUtilities::DoCollision(User* u, TreeServer* server, time_t remo } } - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Nick collision on \"%s\" caused by %s: %s/%lu/%s@%s %d <-> %s/%lu/%s@%s %d", u->nick.c_str(), collidecmd, + ServerInstance->Logs.Debug(MODNAME, "Nick collision on \"%s\" caused by %s: %s/%lu/%s@%s %d <-> %s/%lu/%s@%s %d", u->nick.c_str(), collidecmd, u->uuid.c_str(), (unsigned long)localts, u->ident.c_str(), u->GetIPString().c_str(), bChangeLocal, remoteuid.c_str(), (unsigned long)remotets, remoteident.c_str(), remoteip.c_str(), bChangeRemote); diff --git a/src/modules/m_spanningtree/postcommand.cpp b/src/modules/m_spanningtree/postcommand.cpp index 64fd76852..4769d8a94 100644 --- a/src/modules/m_spanningtree/postcommand.cpp +++ b/src/modules/m_spanningtree/postcommand.cpp @@ -60,7 +60,7 @@ void SpanningTreeUtilities::RouteCommand(TreeServer* origin, CommandBase* thiscm sdest = FindRouteTarget(routing.target); if (!sdest) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Trying to route %s%s to nonexistent server %s", (encap ? "ENCAP " : ""), command.c_str(), routing.target.c_str()); + ServerInstance->Logs.Normal(MODNAME, "Trying to route %s%s to nonexistent server %s", (encap ? "ENCAP " : ""), command.c_str(), routing.target.c_str()); return; } } @@ -76,7 +76,7 @@ void SpanningTreeUtilities::RouteCommand(TreeServer* origin, CommandBase* thiscm Module* srcmodule = thiscmd->creator; if (!(srcmodule->properties & (VF_COMMON | VF_CORE)) && srcmodule != Creator) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Routed command %s from non-VF_COMMON module %s", + ServerInstance->Logs.Normal(MODNAME, "Routed command %s from non-VF_COMMON module %s", command.c_str(), srcmodule->ModuleSourceFile.c_str()); return; } diff --git a/src/modules/m_spanningtree/resolvers.cpp b/src/modules/m_spanningtree/resolvers.cpp index d8ce53d4a..4c449f2c4 100644 --- a/src/modules/m_spanningtree/resolvers.cpp +++ b/src/modules/m_spanningtree/resolvers.cpp @@ -144,7 +144,7 @@ void SecurityIPResolver::OnLookupComplete(const DNS::Query *r) continue; Utils->ValidIPs.push_back(ans_record.rdata); - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Resolved '%s' as a valid IP address for link '%s'", + ServerInstance->Logs.Normal(MODNAME, "Resolved '%s' as a valid IP address for link '%s'", ans_record.rdata.c_str(), MyLink->Name.c_str()); } break; @@ -160,7 +160,7 @@ void SecurityIPResolver::OnError(const DNS::Query *r) if (CheckIPv4()) return; - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Could not resolve IP associated with link '%s': %s", + ServerInstance->Logs.Debug(MODNAME, "Could not resolve IP associated with link '%s': %s", MyLink->Name.c_str(), this->manager->GetErrorStr(r->error).c_str()); } diff --git a/src/modules/m_spanningtree/server.cpp b/src/modules/m_spanningtree/server.cpp index b12c2e5e5..8f0b68b96 100644 --- a/src/modules/m_spanningtree/server.cpp +++ b/src/modules/m_spanningtree/server.cpp @@ -191,7 +191,7 @@ bool TreeSocket::CheckDuplicate(const std::string& sname, const std::string& sid } // Check if the id is not in use by a server that's already fully connected - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Looking for dupe SID %s", sid.c_str()); + ServerInstance->Logs.Debug(MODNAME, "Looking for dupe SID %s", sid.c_str()); CheckDupe = Utils->FindServerID(sid); if (CheckDupe) diff --git a/src/modules/m_spanningtree/sinfo.cpp b/src/modules/m_spanningtree/sinfo.cpp index 5457d84db..1ea2d1774 100644 --- a/src/modules/m_spanningtree/sinfo.cpp +++ b/src/modules/m_spanningtree/sinfo.cpp @@ -43,7 +43,7 @@ CmdResult CommandSInfo::HandleServer(TreeServer* server, CommandBase::Params& pa else if (key == "desc") { // Only sent when the description of a server changes because of a rehash; not sent on burst - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Server description of " + server->GetName() + " changed: " + value); + ServerInstance->Logs.Normal(MODNAME, "Server description of " + server->GetName() + " changed: " + value); server->SetDesc(value); } diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp index 0238c1842..34493716c 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -67,7 +67,7 @@ TreeServer::TreeServer(const std::string& Name, const std::string& Desc, const s , UserCount(0) , Hidden(Hide) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "New server %s behind_bursting %u", GetName().c_str(), behind_bursting); + ServerInstance->Logs.Debug(MODNAME, "New server %s behind_bursting %u", GetName().c_str(), behind_bursting); CheckService(); ServerInstance->Timers.AddTimer(&pingtimer); @@ -138,7 +138,7 @@ void TreeServer::BeginBurst(uint64_t startms) if ((!startms) || (startms > now)) startms = now; this->StartBurst = startms; - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Server %s started bursting at time %s behind_bursting %u", GetId().c_str(), ConvToStr(startms).c_str(), behind_bursting); + ServerInstance->Logs.Debug(MODNAME, "Server %s started bursting at time %s behind_bursting %u", GetId().c_str(), ConvToStr(startms).c_str(), behind_bursting); } void TreeServer::FinishBurstInternal() @@ -147,7 +147,7 @@ void TreeServer::FinishBurstInternal() // introduced during a netburst may later send ENDBURST which would normally decrease this counter if (behind_bursting > 0) behind_bursting--; - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "FinishBurstInternal() %s behind_bursting %u", GetName().c_str(), behind_bursting); + ServerInstance->Logs.Debug(MODNAME, "FinishBurstInternal() %s behind_bursting %u", GetName().c_str(), behind_bursting); for (const auto& child : Children) child->FinishBurstInternal(); @@ -204,7 +204,7 @@ void TreeServer::SQuitInternal(unsigned int& num_lost_servers, bool error) if (isdead) return; - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Server %s lost in split", GetName().c_str()); + ServerInstance->Logs.Debug(MODNAME, "Server %s lost in split", GetName().c_str()); for (const auto& server : Children) server->SQuitInternal(num_lost_servers, error); @@ -247,7 +247,7 @@ void TreeServer::CheckService() { if (this->IsRoot()) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Servers should not mark themselves as a service (at " + tag->source.str() + ")"); + ServerInstance->Logs.Normal(MODNAME, "Servers should not mark themselves as a service (at " + tag->source.str() + ")"); return; } diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 46525bee3..7cf1e170c 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -164,7 +164,7 @@ CmdResult CommandSQuit::HandleServer(TreeServer* server, CommandBase::Params& pa TreeServer* quitting = Utils->FindServer(params[0]); if (!quitting) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Squit from unknown server"); + ServerInstance->Logs.Normal(MODNAME, "Squit from unknown server"); return CmdResult::FAILURE; } @@ -220,8 +220,8 @@ void TreeSocket::OnDataReady() } catch (CoreException& ex) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Error while processing: " + line); - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, ex.GetReason()); + ServerInstance->Logs.Normal(MODNAME, "Error while processing: " + line); + ServerInstance->Logs.Normal(MODNAME, ex.GetReason()); SendError(ex.GetReason() + " - check the log file for details"); } @@ -237,7 +237,7 @@ static std::string newline("\n"); void TreeSocket::WriteLineInternal(const std::string& line) { - ServerInstance->Logs.Log(MODNAME, LOG_RAWIO, "S[%d] O %s", this->GetFd(), line.c_str()); + ServerInstance->Logs.RawIO(MODNAME, "S[%d] O %s", this->GetFd(), line.c_str()); this->WriteData(line); this->WriteData(newline); } diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index de3550b42..0f6cb5d33 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -93,7 +93,7 @@ void TreeSocket::ProcessLine(std::string &line) std::string command; CommandBase::Params params; - ServerInstance->Logs.Log(MODNAME, LOG_RAWIO, "S[%d] I %s", this->GetFd(), line.c_str()); + ServerInstance->Logs.RawIO(MODNAME, "S[%d] I %s", this->GetFd(), line.c_str()); Split(line, tags, prefix, command, params); @@ -308,7 +308,7 @@ void TreeSocket::ProcessConnectedLine(std::string& taglist, std::string& prefix, User* who = FindSource(prefix, command); if (!who) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Command '%s' from unknown prefix '%s'! Dropping entire command.", command.c_str(), prefix.c_str()); + ServerInstance->Logs.Debug(MODNAME, "Command '%s' from unknown prefix '%s'! Dropping entire command.", command.c_str(), prefix.c_str()); return; } @@ -331,7 +331,7 @@ void TreeSocket::ProcessConnectedLine(std::string& taglist, std::string& prefix, TreeServer* const server = TreeServer::Get(who); if (server->GetSocket() != this) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Protocol violation: Fake direction '%s' from connection '%s'", prefix.c_str(), linkID.c_str()); + ServerInstance->Logs.Debug(MODNAME, "Protocol violation: Fake direction '%s' from connection '%s'", prefix.c_str(), linkID.c_str()); return; } diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index 539dbe82f..58b908413 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -204,7 +204,7 @@ void SpanningTreeUtilities::RefreshIPCache() { if (!L->Port) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Ignoring a link block without a port."); + ServerInstance->Logs.Normal(MODNAME, "Ignoring a link block without a port."); /* Invalid link block */ continue; } @@ -293,11 +293,11 @@ void SpanningTreeUtilities::ReadConfiguration() if (L->IPAddr.empty()) { L->IPAddr = "*"; - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Configuration warning: Link block '" + L->Name + "' has no IP defined! This will allow any IP to connect as this server, and MAY not be what you want."); + ServerInstance->Logs.Normal(MODNAME, "Configuration warning: Link block '" + L->Name + "' has no IP defined! This will allow any IP to connect as this server, and MAY not be what you want."); } if (!L->Port && L->IPAddr.find('/') == std::string::npos) - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Configuration warning: Link block '" + L->Name + "' has no port defined, you will not be able to /connect it."); + ServerInstance->Logs.Normal(MODNAME, "Configuration warning: Link block '" + L->Name + "' has no port defined, you will not be able to /connect it."); L->Fingerprint.erase(std::remove(L->Fingerprint.begin(), L->Fingerprint.end(), ':'), L->Fingerprint.end()); LinkBlocks.push_back(L); diff --git a/src/modules/m_sqloper.cpp b/src/modules/m_sqloper.cpp index b6f770cee..fc1cf4e32 100644 --- a/src/modules/m_sqloper.cpp +++ b/src/modules/m_sqloper.cpp @@ -89,7 +89,7 @@ public: ServerConfig::OperIndex::iterator tblk = ServerInstance->Config->OperTypes.find(type); if (tblk == ServerInstance->Config->OperTypes.end()) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Sqloper block " + name + " has missing type " + type); + ServerInstance->Logs.Normal(MODNAME, "Sqloper block " + name + " has missing type " + type); ServerInstance->SNO.WriteGlobalSno('a', "m_sqloper: Oper block %s has missing type %s", name.c_str(), type.c_str()); continue; } @@ -114,7 +114,7 @@ public: void OnError(SQL::Error& error) override { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "query failed (%s)", error.ToString()); + ServerInstance->Logs.Normal(MODNAME, "query failed (%s)", error.ToString()); ServerInstance->SNO.WriteGlobalSno('a', "m_sqloper: Failed to update blocks from database"); if (!uid.empty()) { @@ -154,7 +154,7 @@ public: } else { - ServerInstance->Logs.Log(MODNAME, LOG_SPARSE, "BUG: WHAT?! Why do we have no OPER command?!"); + ServerInstance->Logs.Error(MODNAME, "BUG: WHAT?! Why do we have no OPER command?!"); } } }; @@ -215,7 +215,7 @@ public: */ return MOD_RES_DENY; } - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "database not present"); + ServerInstance->Logs.Normal(MODNAME, "database not present"); } else if (active) { diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index 138e8102e..3bacc1402 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -152,7 +152,7 @@ public: void SetCertificate(User* user, ssl_cert* cert) override { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Setting TLS client certificate for %s: %s", + ServerInstance->Logs.Debug(MODNAME, "Setting TLS client certificate for %s: %s", user->GetFullHost().c_str(), sslext.ToNetwork(user, cert).c_str()); sslext.Set(user, cert); } @@ -416,7 +416,7 @@ public: if (error) { - ServerInstance->Logs.Log("CONNECTCLASS", LOG_DEBUG, "The %s connect class is not suitable as it requires %s", + ServerInstance->Logs.Debug("CONNECTCLASS", "The %s connect class is not suitable as it requires %s", myclass->GetName().c_str(), error); return MOD_RES_DENY; } diff --git a/src/modules/m_topiclock.cpp b/src/modules/m_topiclock.cpp index 30b7ac3f5..744e63ddb 100644 --- a/src/modules/m_topiclock.cpp +++ b/src/modules/m_topiclock.cpp @@ -53,7 +53,7 @@ public: time_t topicts = ConvToNum<time_t>(parameters[1]); if (!topicts) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Received SVSTOPIC with a 0 topicts, dropped."); + ServerInstance->Logs.Normal(MODNAME, "Received SVSTOPIC with a 0 topicts, dropped."); return CmdResult::INVALID; } diff --git a/src/modules/m_vhost.cpp b/src/modules/m_vhost.cpp index 04419f893..73c1e1759 100644 --- a/src/modules/m_vhost.cpp +++ b/src/modules/m_vhost.cpp @@ -111,7 +111,7 @@ public: const std::string hash = tag->getString("hash", "plaintext", 1); if (stdalgo::string::equalsci(hash, "plaintext")) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "<vhost> tag for %s at %s contains an plain text password, this is insecure!", + ServerInstance->Logs.Normal(MODNAME, "<vhost> tag for %s at %s contains an plain text password, this is insecure!", username.c_str(), tag->source.str().c_str()); } diff --git a/src/modules/m_xline_db.cpp b/src/modules/m_xline_db.cpp index f40c2729c..8d9a8f936 100644 --- a/src/modules/m_xline_db.cpp +++ b/src/modules/m_xline_db.cpp @@ -105,17 +105,17 @@ public: * Technically, that means that this can block, but I have *never* seen that. * -- w00t */ - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Opening temporary database"); + ServerInstance->Logs.Debug(MODNAME, "Opening temporary database"); std::string xlinenewdbpath = xlinedbpath + ".new"; std::ofstream stream(xlinenewdbpath); if (!stream.is_open()) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Cannot create database \"%s\"! %s (%d)", xlinenewdbpath.c_str(), strerror(errno), errno); + ServerInstance->Logs.Debug(MODNAME, "Cannot create database \"%s\"! %s (%d)", xlinenewdbpath.c_str(), strerror(errno), errno); ServerInstance->SNO.WriteToSnoMask('x', "database: cannot create new xline db \"%s\": %s (%d)", xlinenewdbpath.c_str(), strerror(errno), errno); return false; } - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Opened. Writing.."); + ServerInstance->Logs.Debug(MODNAME, "Opened. Writing.."); /* * Now, much as I hate writing semi-unportable formats, additional @@ -144,11 +144,11 @@ public: } } - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Finished writing XLines. Checking for error.."); + ServerInstance->Logs.Debug(MODNAME, "Finished writing XLines. Checking for error.."); if (stream.fail()) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Cannot write to new database \"%s\"! %s (%d)", xlinenewdbpath.c_str(), strerror(errno), errno); + ServerInstance->Logs.Debug(MODNAME, "Cannot write to new database \"%s\"! %s (%d)", xlinenewdbpath.c_str(), strerror(errno), errno); ServerInstance->SNO.WriteToSnoMask('x', "database: cannot write to new xline db \"%s\": %s (%d)", xlinenewdbpath.c_str(), strerror(errno), errno); return false; } @@ -160,7 +160,7 @@ public: // Use rename to move temporary to new db - this is guaranteed 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, "Cannot replace old database \"%s\" with new database \"%s\"! %s (%d)", xlinedbpath.c_str(), xlinenewdbpath.c_str(), strerror(errno), errno); + ServerInstance->Logs.Debug(MODNAME, "Cannot replace old database \"%s\" with new database \"%s\"! %s (%d)", xlinedbpath.c_str(), xlinenewdbpath.c_str(), strerror(errno), errno); ServerInstance->SNO.WriteToSnoMask('x', "database: cannot replace old xline db \"%s\" with new db \"%s\": %s (%d)", xlinedbpath.c_str(), xlinenewdbpath.c_str(), strerror(errno), errno); return false; } @@ -178,7 +178,7 @@ public: std::ifstream stream(xlinedbpath); if (!stream.is_open()) { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Cannot read database \"%s\"! %s (%d)", xlinedbpath.c_str(), strerror(errno), errno); + ServerInstance->Logs.Debug(MODNAME, "Cannot read database \"%s\"! %s (%d)", xlinedbpath.c_str(), strerror(errno), errno); ServerInstance->SNO.WriteToSnoMask('x', "database: cannot read xline db \"%s\": %s (%d)", xlinedbpath.c_str(), strerror(errno), errno); return false; } @@ -198,14 +198,14 @@ public: items++; } - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Processing %s", line.c_str()); + ServerInstance->Logs.Debug(MODNAME, "Processing %s", line.c_str()); if (command_p[0] == "VERSION") { if (command_p[1] != "1") { stream.close(); - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "I got database version %s - I don't understand it", command_p[1].c_str()); + ServerInstance->Logs.Debug(MODNAME, "I got database version %s - I don't understand it", command_p[1].c_str()); ServerInstance->SNO.WriteToSnoMask('x', "database: I got a database version (%s) I don't understand", command_p[1].c_str()); return false; } |
