diff options
Diffstat (limited to 'src/modules')
39 files changed, 145 insertions, 145 deletions
diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp index b5c0c1762..f751a846d 100644 --- a/src/modules/extra/m_filter_pcre.cpp +++ b/src/modules/extra/m_filter_pcre.cpp @@ -121,8 +121,8 @@ class ModuleFilterPCRE : public FilterBase if (!re) { - ServerInstance->Log(DEFAULT,"Error in regular expression: %s at offset %d: %s\n", freeform.c_str(), erroffset, error); - ServerInstance->Log(DEFAULT,"Regular expression %s not loaded.", freeform.c_str()); + ServerInstance->Logs->Log("m_filter_pcre", DEFAULT,"Error in regular expression: %s at offset %d: %s\n", freeform.c_str(), erroffset, error); + ServerInstance->Logs->Log("m_filter_pcre", DEFAULT,"Regular expression %s not loaded.", freeform.c_str()); return std::make_pair(false, "Error in regular expression at offset " + ConvToStr(erroffset) + ": "+error); } else @@ -154,13 +154,13 @@ class ModuleFilterPCRE : public FilterBase if (!re) { - ServerInstance->Log(DEFAULT,"Error in regular expression: %s at offset %d: %s\n", pattern.c_str(), erroffset, error); - ServerInstance->Log(DEFAULT,"Regular expression %s not loaded.", pattern.c_str()); + ServerInstance->Logs->Log("CONFIG",DEFAULT,"Error in regular expression: %s at offset %d: %s\n", pattern.c_str(), erroffset, error); + ServerInstance->Logs->Log("CONFIG",DEFAULT,"Regular expression %s not loaded.", pattern.c_str()); } else { filters.push_back(PCREFilter(re, reason, action, gline_time, pattern, flgs)); - ServerInstance->Log(DEFAULT,"Regular expression %s loaded.", pattern.c_str()); + ServerInstance->Logs->Log("CONFIG",DEFAULT,"Regular expression %s loaded.", pattern.c_str()); } } FilterBase::OnRehash(user, parameter); diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index 03dd99342..d79eb11ff 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -543,7 +543,7 @@ void ConnectDatabases(InspIRCd* ServerInstance) { /* XXX: MUTEX */ pthread_mutex_lock(&logging_mutex); - ServerInstance->Log(DEFAULT,"SQL: Failed to connect database "+i->second->GetHost()+": Error: "+i->second->GetError()); + ServerInstance->Logs->Log("m_mysql",DEFAULT,"SQL: Failed to connect database "+i->second->GetHost()+": Error: "+i->second->GetError()); i->second->SetEnable(false); pthread_mutex_unlock(&logging_mutex); } @@ -742,7 +742,7 @@ class ModuleSQL : public Module rc = pthread_join(Dispatcher, &status); if (rc) { - ServerInstance->Log(DEFAULT,"SQL: Error code from pthread_join() is " + rc); + ServerInstance->Logs->Log("m_mysql",DEFAULT,"SQL: Error code from pthread_join() is " + rc); } throw ModuleException("m_mysql: Unable to publish feature 'SQL'"); } @@ -760,7 +760,7 @@ class ModuleSQL : public Module rc = pthread_join(Dispatcher, &status); if (rc) { - ServerInstance->Log(DEFAULT,"SQL: Error code from pthread_join() is " + rc); + ServerInstance->Logs->Log("m_mysql",DEFAULT,"SQL: Error code from pthread_join() is " + rc); } ClearAllConnections(); delete Conf; diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index a77e1ac90..72351cc93 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -111,7 +111,7 @@ class SQLresolver : public Resolver virtual void OnError(ResolverError e, const std::string &errormessage) { - ServerInstance->Log(DEBUG, "PgSQL: DNS lookup failed (%s), dying horribly", errormessage.c_str()); + ServerInstance->Logs->Log("m_pgsql",DEBUG, "PgSQL: DNS lookup failed (%s), dying horribly", errormessage.c_str()); } }; @@ -331,7 +331,7 @@ class SQLConn : public EventHandler idle = this->Instance->Time(); if(!DoConnect()) { - Instance->Log(DEFAULT, "WARNING: Could not connect to database with id: " + ConvToStr(hi.id)); + Instance->Logs->Log("m_pgsql",DEFAULT, "WARNING: Could not connect to database with id: " + ConvToStr(hi.id)); DelayReconnect(); } } @@ -383,7 +383,7 @@ class SQLConn : public EventHandler if (!this->Instance->SE->AddFd(this)) { - Instance->Log(DEBUG, "BUG: Couldn't add pgsql socket to socket engine"); + Instance->Logs->Log("m_pgsql",DEBUG, "BUG: Couldn't add pgsql socket to socket engine"); return false; } @@ -621,7 +621,7 @@ class SQLConn : public EventHandler #endif if(error) { - Instance->Log(DEBUG, "BUG: Apparently PQescapeStringConn() failed somehow...don't know how or what to do..."); + Instance->Logs->Log("m_pgsql",DEBUG, "BUG: Apparently PQescapeStringConn() failed somehow...don't know how or what to do..."); } /* Incremenet queryend to the end of the newly escaped parameter */ @@ -632,7 +632,7 @@ class SQLConn : public EventHandler } else { - Instance->Log(DEBUG, "BUG: Found a substitution location but no parameter to substitute :|"); + Instance->Logs->Log("m_pgsql",DEBUG, "BUG: Found a substitution location but no parameter to substitute :|"); break; } } @@ -698,7 +698,7 @@ class SQLConn : public EventHandler } else { - Instance->Log(DEBUG, "BUG: PQsocket cant be removed from socket engine!"); + Instance->Logs->Log("m_pgsql",DEBUG, "BUG: PQsocket cant be removed from socket engine!"); } } @@ -846,7 +846,7 @@ class ModulePgSQL : public Module else { /* Invalid address family, die horribly. */ - ServerInstance->Log(DEBUG, "BUG: insp_aton failed returning -1, oh noes."); + ServerInstance->Logs->Log("m_pgsql",DEBUG, "BUG: insp_aton failed returning -1, oh noes."); } } } @@ -880,7 +880,7 @@ class ModulePgSQL : public Module { if (HasHost(hi)) { - ServerInstance->Log(DEFAULT, "WARNING: A pgsql connection with id: %s already exists, possibly due to DNS delay. Aborting connection attempt.", hi.id.c_str()); + ServerInstance->Logs->Log("m_pgsql",DEFAULT, "WARNING: A pgsql connection with id: %s already exists, possibly due to DNS delay. Aborting connection attempt.", hi.id.c_str()); return; } diff --git a/src/modules/extra/m_rline.cpp b/src/modules/extra/m_rline.cpp index 189479efc..409e01ccd 100644 --- a/src/modules/extra/m_rline.cpp +++ b/src/modules/extra/m_rline.cpp @@ -62,7 +62,7 @@ class CoreExport RLine : public XLine { std::string compare = std::string(u->nick) + "!" + u->ident + "@" + u->host + " " + u->fullname; - ServerInstance->Log(DEBUG, "Matching " + matchtext + " against string " + compare); + ServerInstance->Logs->Log("m_rline",DEBUG, "Matching " + matchtext + " against string " + compare); if (pcre_exec(regex, NULL, compare.c_str(), compare.length(), 0, 0, NULL, 0) > -1) { diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp index 1e62eb971..9a5c900f2 100644 --- a/src/modules/extra/m_sqlite3.cpp +++ b/src/modules/extra/m_sqlite3.cpp @@ -264,7 +264,7 @@ class SQLConn : public classbase { if (OpenDB() != SQLITE_OK) { - Instance->Log(DEFAULT, "WARNING: Could not open DB with id: " + host.id); + Instance->Logs->Log("m_sqlite3",DEFAULT, "WARNING: Could not open DB with id: " + host.id); CloseDB(); } } @@ -572,7 +572,7 @@ class ModuleSQLite3 : public Module { if (HasHost(hi)) { - ServerInstance->Log(DEFAULT, "WARNING: A sqlite connection with id: %s already exists. Aborting database open attempt.", hi.id.c_str()); + ServerInstance->Logs->Log("m_sqlite3",DEFAULT, "WARNING: A sqlite connection with id: %s already exists. Aborting database open attempt.", hi.id.c_str()); return; } diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp index a1e28bafe..01ff0b3d4 100644 --- a/src/modules/extra/m_sqloper.cpp +++ b/src/modules/extra/m_sqloper.cpp @@ -128,7 +128,7 @@ public: } else { - ServerInstance->Log(SPARSE, "WARNING: Couldn't find SQL provider module. NOBODY will be able to oper up unless their o:line is statically configured"); + ServerInstance->Logs->Log("m_sqloper",SPARSE, "WARNING: Couldn't find SQL provider module. NOBODY will be able to oper up unless their o:line is statically configured"); return false; } } @@ -235,7 +235,7 @@ public: } else { - ServerInstance->Log(DEBUG, "BUG: WHAT?! Why do we have no OPER command?!"); + ServerInstance->Logs->Log("m_sqloper",DEBUG, "BUG: WHAT?! Why do we have no OPER command?!"); } } diff --git a/src/modules/extra/m_sqlutils.cpp b/src/modules/extra/m_sqlutils.cpp index 30fcf968e..5935e1553 100644 --- a/src/modules/extra/m_sqlutils.cpp +++ b/src/modules/extra/m_sqlutils.cpp @@ -123,14 +123,14 @@ public: { if(iter->second != user) { - ServerInstance->Log(DEBUG, "BUG: ID associated with user %s doesn't have the same User* associated with it in the map (erasing anyway)", user->nick); + ServerInstance->Logs->Log("m_sqlutils",DEBUG, "BUG: ID associated with user %s doesn't have the same User* associated with it in the map (erasing anyway)", user->nick); } iduser.erase(iter); } else { - ServerInstance->Log(DEBUG, "BUG: user %s was extended with sqlutils_queryids but there was nothing matching in the map", user->nick); + ServerInstance->Logs->Log("m_sqlutils",DEBUG, "BUG: user %s was extended with sqlutils_queryids but there was nothing matching in the map", user->nick); } } @@ -210,13 +210,13 @@ public: { if(iter->second != chan) { - ServerInstance->Log(DEBUG, "BUG: ID associated with channel %s doesn't have the same Channel* associated with it in the map (erasing anyway)", chan->name); + ServerInstance->Logs->Log("m_sqlutils",DEBUG, "BUG: ID associated with channel %s doesn't have the same Channel* associated with it in the map (erasing anyway)", chan->name); } idchan.erase(iter); } else { - ServerInstance->Log(DEBUG, "BUG: channel %s was extended with sqlutils_queryids but there was nothing matching in the map", chan->name); + ServerInstance->Logs->Log("m_sqlutils",DEBUG, "BUG: channel %s was extended with sqlutils_queryids but there was nothing matching in the map", chan->name); } } diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index e1f4b8451..f79ef47fa 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -99,11 +99,11 @@ class ModuleSSLGnuTLS : public Module gnutls_global_init(); // This must be called once in the program if(gnutls_certificate_allocate_credentials(&x509_cred) != 0) - ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Failed to allocate certificate credentials"); + ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: Failed to allocate certificate credentials"); // Guessing return meaning if(gnutls_dh_params_init(&dh_params) < 0) - ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Failed to initialise DH parameters"); + ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: Failed to initialise DH parameters"); // Needs the flag as it ignores a plain /rehash OnRehash(NULL,"ssl"); @@ -149,17 +149,17 @@ class ModuleSSLGnuTLS : public Module for (size_t i = 0; i < ServerInstance->Config->ports.size(); i++) if (ServerInstance->Config->ports[i]->GetPort() == portno) ServerInstance->Config->ports[i]->SetDescription("ssl"); - ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %d", portno); + ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %d", portno); sslports.append("*:").append(ConvToStr(portno)).append(";"); } else { - ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: FAILED to enable SSL on port %d, maybe you have another ssl or similar module loaded?", portno); + ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: FAILED to enable SSL on port %d, maybe you have another ssl or similar module loaded?", portno); } } catch (ModuleException &e) { - ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: FAILED to enable SSL on port %d: %s. Maybe it's already hooked by the same port on a different IP, or you have an other SSL or similar module loaded?", portno, e.GetReason()); + ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: FAILED to enable SSL on port %d: %s. Maybe it's already hooked by the same port on a different IP, or you have an other SSL or similar module loaded?", portno, e.GetReason()); } } } @@ -213,10 +213,10 @@ class ModuleSSLGnuTLS : public Module int ret; if((ret =gnutls_certificate_set_x509_trust_file(x509_cred, cafile.c_str(), GNUTLS_X509_FMT_PEM)) < 0) - ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Failed to set X.509 trust file '%s': %s", cafile.c_str(), gnutls_strerror(ret)); + ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: Failed to set X.509 trust file '%s': %s", cafile.c_str(), gnutls_strerror(ret)); if((ret = gnutls_certificate_set_x509_crl_file (x509_cred, crlfile.c_str(), GNUTLS_X509_FMT_PEM)) < 0) - ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Failed to set X.509 CRL file '%s': %s", crlfile.c_str(), gnutls_strerror(ret)); + ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: Failed to set X.509 CRL file '%s': %s", crlfile.c_str(), gnutls_strerror(ret)); if((ret = gnutls_certificate_set_x509_key_file (x509_cred, certfile.c_str(), keyfile.c_str(), GNUTLS_X509_FMT_PEM)) < 0) { @@ -240,7 +240,7 @@ class ModuleSSLGnuTLS : public Module int ret; if((ret = gnutls_dh_params_generate2(dh_params, dh_bits)) < 0) - ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Failed to generate DH parameters (%d bits): %s", dh_bits, gnutls_strerror(ret)); + ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: Failed to generate DH parameters (%d bits): %s", dh_bits, gnutls_strerror(ret)); } virtual ~ModuleSSLGnuTLS() diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 667b2a5cd..2af851f05 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -188,17 +188,17 @@ class ModuleSSLOpenSSL : public Module for (size_t i = 0; i < ServerInstance->Config->ports.size(); i++) if (ServerInstance->Config->ports[i]->GetPort() == portno) ServerInstance->Config->ports[i]->SetDescription("ssl"); - ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %d", portno); + ServerInstance->Logs->Log("m_ssl_openssl",DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %d", portno); sslports.append("*:").append(ConvToStr(portno)).append(";"); } else { - ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: FAILED to enable SSL on port %d, maybe you have another ssl or similar module loaded?", portno); + ServerInstance->Logs->Log("m_ssl_openssl",DEFAULT, "m_ssl_openssl.so: FAILED to enable SSL on port %d, maybe you have another ssl or similar module loaded?", portno); } } catch (ModuleException &e) { - ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: FAILED to enable SSL on port %d: %s. Maybe it's already hooked by the same port on a different IP, or you have another SSL or similar module loaded?", portno, e.GetReason()); + ServerInstance->Logs->Log("m_ssl_openssl",DEFAULT, "m_ssl_openssl.so: FAILED to enable SSL on port %d: %s. Maybe it's already hooked by the same port on a different IP, or you have another SSL or similar module loaded?", portno, e.GetReason()); } } } @@ -252,20 +252,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->Log(DEFAULT, "m_ssl_openssl.so: Can't read certificate file %s. %s", certfile.c_str(), strerror(errno)); + ServerInstance->Logs->Log("m_ssl_openssl",DEFAULT, "m_ssl_openssl.so: 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->Log(DEFAULT, "m_ssl_openssl.so: Can't read key file %s. %s", keyfile.c_str(), strerror(errno)); + ServerInstance->Logs->Log("m_ssl_openssl",DEFAULT, "m_ssl_openssl.so: 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->Log(DEFAULT, "m_ssl_openssl.so: Can't read CA list from %s. %s", cafile.c_str(), strerror(errno)); + ServerInstance->Logs->Log("m_ssl_openssl",DEFAULT, "m_ssl_openssl.so: Can't read CA list from %s. %s", cafile.c_str(), strerror(errno)); ERR_print_errors_cb(error_callback, this); } @@ -274,7 +274,7 @@ class ModuleSSLOpenSSL : public Module if (dhpfile == NULL) { - ServerInstance->Log(DEFAULT, "m_ssl_openssl.so Couldn't open DH file %s: %s", dhfile.c_str(), strerror(errno)); + ServerInstance->Logs->Log("m_ssl_openssl",DEFAULT, "m_ssl_openssl.so Couldn't open DH file %s: %s", dhfile.c_str(), strerror(errno)); throw ModuleException("Couldn't open DH file " + dhfile + ": " + strerror(errno)); } else @@ -282,7 +282,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->Log(DEFAULT, "m_ssl_openssl.so: Couldn't set DH parameters %s. SSL errors follow:", dhfile.c_str()); + ServerInstance->Logs->Log("m_ssl_openssl",DEFAULT, "m_ssl_openssl.so: Couldn't set DH parameters %s. SSL errors follow:", dhfile.c_str()); ERR_print_errors_cb(error_callback, this); } } @@ -409,7 +409,7 @@ class ModuleSSLOpenSSL : public Module if (SSL_set_fd(session->sess, fd) == 0) { - ServerInstance->Log(DEBUG,"BUG: Can't set fd with SSL_set_fd: %d", fd); + ServerInstance->Logs->Log("m_ssl_openssl",DEBUG,"BUG: Can't set fd with SSL_set_fd: %d", fd); return; } @@ -436,7 +436,7 @@ class ModuleSSLOpenSSL : public Module if (SSL_set_fd(session->sess, fd) == 0) { - ServerInstance->Log(DEBUG,"BUG: Can't set fd with SSL_set_fd: %d", fd); + ServerInstance->Logs->Log("m_ssl_openssl",DEBUG,"BUG: Can't set fd with SSL_set_fd: %d", fd); return; } @@ -886,7 +886,7 @@ class ModuleSSLOpenSSL : public Module static int error_callback(const char *str, size_t len, void *u) { ModuleSSLOpenSSL* mssl = (ModuleSSLOpenSSL*)u; - mssl->PublicInstance->Log(DEFAULT, "SSL error: " + std::string(str, len - 1)); + mssl->PublicInstance->Logs->Log("m_ssl_openssl",DEFAULT, "SSL error: " + std::string(str, len - 1)); return 0; } diff --git a/src/modules/extra/m_ssl_oper_cert.cpp b/src/modules/extra/m_ssl_oper_cert.cpp index 312ec874b..abf8c5d4a 100644 --- a/src/modules/extra/m_ssl_oper_cert.cpp +++ b/src/modules/extra/m_ssl_oper_cert.cpp @@ -159,7 +159,7 @@ class ModuleOperSSLCert : public Module { user->WriteServ("491 %s :This oper login name requires a matching key fingerprint.",user->nick); ServerInstance->SNO->WriteToSnoMask('o',"'%s' cannot oper, does not match fingerprint", user->nick); - ServerInstance->Log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but wrong fingerprint.",user->nick,user->ident,user->host); + ServerInstance->Logs->Log("m_ssl_oper_cert",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but wrong fingerprint.",user->nick,user->ident,user->host); return 1; } } diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp index cfad61f17..bcbc82cac 100644 --- a/src/modules/m_blockcaps.cpp +++ b/src/modules/m_blockcaps.cpp @@ -115,12 +115,12 @@ public: capsmap[(unsigned char)*n] = 1; if (percent < 1 || percent > 100) { - ServerInstance->Log(DEFAULT, "<blockcaps:percent> out of range, setting to default of 100."); + ServerInstance->Logs->Log("CONFIG",DEFAULT, "<blockcaps:percent> out of range, setting to default of 100."); percent = 100; } if (minlen < 1 || minlen > MAXBUF-1) { - ServerInstance->Log(DEFAULT, "<blockcaps:minlen> out of range, setting to default of 1."); + ServerInstance->Logs->Log("CONFIG",DEFAULT, "<blockcaps:minlen> out of range, setting to default of 1."); minlen = 1; } } diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 633e95af9..3f7e27418 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -172,7 +172,7 @@ public: if(hostmask.length()) { if (type == "webirc" && !password.length()) { - ServerInstance->Log(DEFAULT, "m_cgiirc: Missing password in config: %s", hostmask.c_str()); + ServerInstance->Logs->Log("CONFIG",DEFAULT, "m_cgiirc: Missing password in config: %s", hostmask.c_str()); } else { @@ -196,7 +196,7 @@ public: } else { - ServerInstance->Log(DEFAULT, "m_cgiirc.so: Invalid <cgihost:mask> value in config: %s", hostmask.c_str()); + ServerInstance->Logs->Log("CONFIG",DEFAULT, "m_cgiirc.so: Invalid <cgihost:mask> value in config: %s", hostmask.c_str()); continue; } } diff --git a/src/modules/m_filter.h b/src/modules/m_filter.h index 1be1f85ff..e1f97bd72 100644 --- a/src/modules/m_filter.h +++ b/src/modules/m_filter.h @@ -289,7 +289,7 @@ int FilterBase::OnUserPreNotice(User* user,void* dest,int target_type, std::stri delete gl; } - ServerInstance->Log(DEFAULT,"FILTER: "+std::string(user->nick)+std::string(" had their message filtered, target was ")+target+": "+f->reason+" Action: "+f->action); + ServerInstance->Logs->Log("FILTER",DEFAULT,"FILTER: "+std::string(user->nick)+std::string(" had their message filtered, target was ")+target+": "+f->reason+" Action: "+f->action); return 1; } return 0; diff --git a/src/modules/m_foobar.cpp b/src/modules/m_foobar.cpp index 612b9d62b..bffdd7730 100644 --- a/src/modules/m_foobar.cpp +++ b/src/modules/m_foobar.cpp @@ -57,7 +57,7 @@ class ModuleFoobar : public Module // method called when a user connects std::string b = user->nick; - ServerInstance->Log(DEBUG,"Foobar: User connecting: "+b); + ServerInstance->Logs->Log("m_foobar",DEBUG,"Foobar: User connecting: "+b); } virtual void OnUserQuit(User* user, const std::string &reason, const std::string &oper_message) @@ -65,7 +65,7 @@ class ModuleFoobar : public Module // method called when a user disconnects std::string b = user->nick; - ServerInstance->Log(DEBUG,"Foobar: User quitting: "+b); + ServerInstance->Logs->Log("m_foobar",DEBUG,"Foobar: User quitting: "+b); } virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent) @@ -74,7 +74,7 @@ class ModuleFoobar : public Module std::string c = channel->name; std::string b = user->nick; - ServerInstance->Log(DEBUG,"Foobar: User "+b+" joined "+c); + ServerInstance->Logs->Log("m_foobar",DEBUG,"Foobar: User "+b+" joined "+c); } virtual void OnUserPart(User* user, Channel* channel, const std::string &partreason, bool &silent) @@ -83,7 +83,7 @@ class ModuleFoobar : public Module std::string c = channel->name; std::string b = user->nick; - ServerInstance->Log(DEBUG,"Foobar: User "+b+" parted "+c); + ServerInstance->Logs->Log("m_foobar",DEBUG,"Foobar: User "+b+" parted "+c); } }; diff --git a/src/modules/m_http_client.cpp b/src/modules/m_http_client.cpp index 4cb7b2848..9cf6e45b4 100644 --- a/src/modules/m_http_client.cpp +++ b/src/modules/m_http_client.cpp @@ -56,13 +56,13 @@ class HTTPResolver : public Resolver public: HTTPResolver(HTTPSocket *s, InspIRCd *Instance, const std::string &hostname, bool &cached, Module* me) : Resolver(Instance, hostname, DNS_QUERY_FORWARD, cached, me), socket(s) { - ServerInstance->Log(DEBUG,">>>>>>>>>>>>>>>>>> HTTPResolver::HTTPResolver <<<<<<<<<<<<<<<"); + ServerInstance->Logs->Log("m_http_client",DEBUG,">>>>>>>>>>>>>>>>>> HTTPResolver::HTTPResolver <<<<<<<<<<<<<<<"); orig = hostname; } void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached, int resultnum = 0) { - ServerInstance->Log(DEBUG,"************* HTTPResolver::OnLookupComplete ***************"); + ServerInstance->Logs->Log("m_http_client",DEBUG,"************* HTTPResolver::OnLookupComplete ***************"); if (!resultnum) socket->Connect(result); else @@ -71,7 +71,7 @@ class HTTPResolver : public Resolver void OnError(ResolverError e, const std::string &errmsg) { - ServerInstance->Log(DEBUG,"!!!!!!!!!!!!!!!! HTTPResolver::OnError: %s", errmsg.c_str()); + ServerInstance->Logs->Log("m_http_client",DEBUG,"!!!!!!!!!!!!!!!! HTTPResolver::OnError: %s", errmsg.c_str()); socket->OnClose(); } }; @@ -119,7 +119,7 @@ class ModuleHTTPClient : public Module HTTPSocket::HTTPSocket(InspIRCd *SI, ModuleHTTPClient *m) : BufferedSocket(SI), Server(SI), Mod(m), status(HTTP_CLOSED) { - Instance->Log(DEBUG,"HTTPSocket::HTTPSocket"); + Instance->Logs->Log("m_http_client",DEBUG,"HTTPSocket::HTTPSocket"); this->port = 80; response = NULL; closed = false; @@ -141,7 +141,7 @@ HTTPSocket::~HTTPSocket() bool HTTPSocket::DoRequest(HTTPClientRequest *request) { - Instance->Log(DEBUG,"HTTPSocket::DoRequest"); + Instance->Logs->Log("m_http_client",DEBUG,"HTTPSocket::DoRequest"); /* Tweak by brain - we take a copy of this, * so that the caller doesnt need to leave * pointers knocking around, less chance of @@ -155,7 +155,7 @@ bool HTTPSocket::DoRequest(HTTPClientRequest *request) this->port = url.port; strlcpy(this->host, url.domain.c_str(), MAXBUF); - Instance->Log(DEBUG,"Doing request for %s", url.url.c_str()); + Instance->Logs->Log("m_http_client",DEBUG,"Doing request for %s", url.url.c_str()); in6_addr s6; in_addr s4; @@ -165,7 +165,7 @@ bool HTTPSocket::DoRequest(HTTPClientRequest *request) bool cached; HTTPResolver* r = new HTTPResolver(this, Server, url.domain, cached, (Module*)Mod); Instance->AddResolver(r, cached); - Instance->Log(DEBUG,"Resolver added, cached=%d", cached); + Instance->Logs->Log("m_http_client",DEBUG,"Resolver added, cached=%d", cached); } else Connect(url.domain); @@ -175,7 +175,7 @@ bool HTTPSocket::DoRequest(HTTPClientRequest *request) bool HTTPSocket::ParseURL(const std::string &iurl) { - Instance->Log(DEBUG,"HTTPSocket::ParseURL %s", iurl.c_str()); + Instance->Logs->Log("m_http_client",DEBUG,"HTTPSocket::ParseURL %s", iurl.c_str()); url.url = iurl; url.port = 80; url.protocol = "http"; @@ -243,13 +243,13 @@ bool HTTPSocket::ParseURL(const std::string &iurl) if ((url.domain.empty()) || (!url.port) || (url.protocol.empty())) { - Instance->Log(DEFAULT, "Invalid URL (%s): Missing required value", iurl.c_str()); + Instance->Logs->Log("m_http_client",DEFAULT, "Invalid URL (%s): Missing required value", iurl.c_str()); return false; } if (url.protocol != "http") { - Instance->Log(DEFAULT, "Invalid URL (%s): Unsupported protocol '%s'", iurl.c_str(), url.protocol.c_str()); + Instance->Logs->Log("m_http_client",DEFAULT, "Invalid URL (%s): Unsupported protocol '%s'", iurl.c_str(), url.protocol.c_str()); return false; } @@ -260,20 +260,20 @@ void HTTPSocket::Connect(const std::string &ip) { this->response = new HTTPClientResponse((Module*)Mod, req.GetSource() , url.url, 0, ""); - Instance->Log(DEBUG,"HTTPSocket::Connect(%s) response=%08lx", ip.c_str(), response); + Instance->Logs->Log("m_http_client",DEBUG,"HTTPSocket::Connect(%s) response=%08lx", ip.c_str(), response); strlcpy(this->IP, ip.c_str(), MAXBUF); strlcpy(this->host, ip.c_str(), MAXBUF); if (!this->DoConnect()) { - Instance->Log(DEBUG,"DoConnect failed, bailing"); + Instance->Logs->Log("m_http_client",DEBUG,"DoConnect failed, bailing"); this->Close(); } } bool HTTPSocket::OnConnected() { - Instance->Log(DEBUG,"HTTPSocket::OnConnected"); + Instance->Logs->Log("m_http_client",DEBUG,"HTTPSocket::OnConnected"); std::string request = "GET " + url.request + " HTTP/1.1\r\n"; @@ -297,7 +297,7 @@ bool HTTPSocket::OnConnected() bool HTTPSocket::OnDataReady() { - Instance->Log(DEBUG,"HTTPSocket::OnDataReady() for %s", url.url.c_str()); + Instance->Logs->Log("m_http_client",DEBUG,"HTTPSocket::OnDataReady() for %s", url.url.c_str()); const char *sdata = this->Read(); if (!sdata) @@ -354,18 +354,18 @@ void HTTPSocket::OnClose() if (!closed) { closed = true; - Instance->Log(DEBUG,"HTTPSocket::OnClose response=%08lx", response); + Instance->Logs->Log("m_http_client",DEBUG,"HTTPSocket::OnClose response=%08lx", response); std::string e; if (data.empty()) { - Instance->Log(DEBUG,"Send error"); + Instance->Logs->Log("m_http_client",DEBUG,"Send error"); HTTPClientError* err = new HTTPClientError((Module*)Mod, req.GetSource(), req.GetURL(), 0); err->Send(); delete err; return; } - Instance->Log(DEBUG,"Set data and send, %s", response->GetURL().c_str()); + Instance->Logs->Log("m_http_client",DEBUG,"Set data and send, %s", response->GetURL().c_str()); response->SetData(data); response->Send(); delete response; diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index 56a24119f..3bf99bfdf 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -290,7 +290,7 @@ class HttpServerSocket : public BufferedSocket if (reqbuffer.length() >= 8192) { - Instance->Log(DEBUG, "m_httpd dropped connection due to an oversized request buffer"); + Instance->Logs->Log("m_httpd",DEBUG, "m_httpd dropped connection due to an oversized request buffer"); reqbuffer.clear(); return false; } diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index 185b9cf6d..fd9fd4434 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -180,7 +180,7 @@ class IdentRequestSocket : public EventHandler virtual void OnConnected() { - ServerInstance->Log(DEBUG,"OnConnected()"); + ServerInstance->Logs->Log("m_ident",DEBUG,"OnConnected()"); /* Both sockaddr_in and sockaddr_in6 can be safely casted to sockaddr, especially since the * only members we use are in a part of the struct that should always be identical (at the @@ -230,7 +230,7 @@ class IdentRequestSocket : public EventHandler break; case EVENT_ERROR: /* fd error event, ohshi- */ - ServerInstance->Log(DEBUG,"EVENT_ERROR"); + ServerInstance->Logs->Log("m_ident",DEBUG,"EVENT_ERROR"); /* We *must* Close() here immediately or we get a * huge storm of EVENT_ERROR events! */ @@ -247,7 +247,7 @@ class IdentRequestSocket : public EventHandler */ if (GetFd() > -1) { - ServerInstance->Log(DEBUG,"Close ident socket %d", GetFd()); + ServerInstance->Logs->Log("m_ident",DEBUG,"Close ident socket %d", GetFd()); ServerInstance->SE->DelFd(this); ServerInstance->SE->Close(GetFd()); ServerInstance->SE->Shutdown(GetFd(), SHUT_WR); @@ -286,7 +286,7 @@ class IdentRequestSocket : public EventHandler return; } - ServerInstance->Log(DEBUG,"ReadResponse()"); + ServerInstance->Logs->Log("m_ident",DEBUG,"ReadResponse()"); irc::sepstream sep(ibuf, ':'); std::string token; @@ -402,7 +402,7 @@ class ModuleIdent : public Module } catch (ModuleException &e) { - ServerInstance->Log(DEBUG,"Ident exception: %s", e.GetReason()); + ServerInstance->Logs->Log("m_ident",DEBUG,"Ident exception: %s", e.GetReason()); return 0; } @@ -416,17 +416,17 @@ class ModuleIdent : public Module */ virtual bool OnCheckReady(User *user) { - ServerInstance->Log(DEBUG,"OnCheckReady %s", user->nick); + ServerInstance->Logs->Log("m_ident",DEBUG,"OnCheckReady %s", user->nick); /* Does user have an ident socket attached at all? */ IdentRequestSocket *isock = NULL; if (!user->GetExt("ident_socket", isock)) { - ServerInstance->Log(DEBUG, "No ident socket :("); + ServerInstance->Logs->Log("m_ident",DEBUG, "No ident socket :("); return true; } - ServerInstance->Log(DEBUG, "Has ident_socket"); + ServerInstance->Logs->Log("m_ident",DEBUG, "Has ident_socket"); time_t compare = isock->age; compare += RequestTimeout; @@ -436,7 +436,7 @@ class ModuleIdent : public Module { /* Ident timeout */ user->WriteServ("NOTICE Auth :*** Ident request timed out."); - ServerInstance->Log(DEBUG, "Timeout"); + ServerInstance->Logs->Log("m_ident",DEBUG, "Timeout"); /* The user isnt actually disconnecting, * we call this to clean up the user */ @@ -447,11 +447,11 @@ class ModuleIdent : public Module /* Got a result yet? */ if (!isock->HasResult()) { - ServerInstance->Log(DEBUG, "No result yet"); + ServerInstance->Logs->Log("m_ident",DEBUG, "No result yet"); return false; } - ServerInstance->Log(DEBUG, "Yay, result!"); + ServerInstance->Logs->Log("m_ident",DEBUG, "Yay, result!"); /* wooo, got a result (it will be good, or bad) */ if (*(isock->GetResult()) != '~') @@ -483,7 +483,7 @@ class ModuleIdent : public Module isock->Close(); delete isock; user->Shrink("ident_socket"); - ServerInstance->Log(DEBUG, "Removed ident socket from %s", user->nick); + ServerInstance->Logs->Log("m_ident",DEBUG, "Removed ident socket from %s", user->nick); } } }; diff --git a/src/modules/m_operlog.cpp b/src/modules/m_operlog.cpp index eac5a9407..a9ce4aa9b 100644 --- a/src/modules/m_operlog.cpp +++ b/src/modules/m_operlog.cpp @@ -52,7 +52,7 @@ class ModuleOperLog : public Module for (int j = 0; j < pcnt; j++) plist.append(std::string(" ")+std::string(parameters[j])); - ServerInstance->Log(DEFAULT,"OPERLOG: [%s!%s@%s] %s%s",user->nick,user->ident,user->host,command.c_str(),plist.c_str()); + ServerInstance->Logs->Log("m_operlog",DEFAULT,"OPERLOG: [%s!%s@%s] %s%s",user->nick,user->ident,user->host,command.c_str(),plist.c_str()); } } diff --git a/src/modules/m_password_hash.cpp b/src/modules/m_password_hash.cpp index 0db1147dd..bd039865a 100644 --- a/src/modules/m_password_hash.cpp +++ b/src/modules/m_password_hash.cpp @@ -120,7 +120,7 @@ class ModuleOperHash : public Module { if (ServerInstance->Modules->ModuleHasInterface(mod, "HashRequest")) { - ServerInstance->Log(DEBUG, "Post-load registering hasher: %s", name.c_str()); + ServerInstance->Logs->Log("m_password-hash",DEBUG, "Post-load registering hasher: %s", name.c_str()); std::string sname = HashNameRequest(this, mod).Send(); hashers[sname.c_str()] = mod; names.push_back(sname); diff --git a/src/modules/m_proxyscan.cpp b/src/modules/m_proxyscan.cpp index f65382ac1..6b2c489f8 100644 --- a/src/modules/m_proxyscan.cpp +++ b/src/modules/m_proxyscan.cpp @@ -189,7 +189,7 @@ class ProxySocket : public EventHandler virtual void OnConnected() { - ServerInstance->Log(DEBUG,"OnConnected()"); + ServerInstance->Logs->Log("m_proxyscan",DEBUG,"OnConnected()"); /* Both sockaddr_in and sockaddr_in6 can be safely casted to sockaddr, especially since the * only members we use are in a part of the struct that should always be identical (at the @@ -212,10 +212,10 @@ class ProxySocket : public EventHandler /* Send failed if we didnt write the whole ident request -- * might as well give up if this happens! */ - ServerInstance->Log(DEBUG, "Sending"); + ServerInstance->Logs->Log("m_proxyscan",DEBUG, "Sending"); if (ServerInstance->SE->Send(this, this->challenge, this->clen, 0) < this->clen) { - ServerInstance->Log(DEBUG, "Send incomplete"); + ServerInstance->Logs->Log("m_proxyscan",DEBUG, "Send incomplete"); done = true; } } @@ -234,7 +234,7 @@ class ProxySocket : public EventHandler break; case EVENT_ERROR: /* fd error event, ohshi- */ - ServerInstance->Log(DEBUG,"EVENT_ERROR"); + ServerInstance->Logs->Log("m_proxyscan",DEBUG,"EVENT_ERROR"); /* We *must* Close() here immediately or we get a * huge storm of EVENT_ERROR events! */ @@ -251,7 +251,7 @@ class ProxySocket : public EventHandler */ if (GetFd() > -1) { - ServerInstance->Log(DEBUG,"Close ident socket %d", GetFd()); + ServerInstance->Logs->Log("m_proxyscan",DEBUG,"Close ident socket %d", GetFd()); ServerInstance->SE->DelFd(this); ServerInstance->SE->Close(GetFd()); ServerInstance->SE->Shutdown(GetFd(), SHUT_WR); @@ -272,7 +272,7 @@ class ProxySocket : public EventHandler char ibuf[MAXBUF]; int recvresult = ServerInstance->SE->Recv(this, ibuf, MAXBUF-1, 0); - ServerInstance->Log(DEBUG,"ReadResponse(): %s -- %d", ibuf, recvresult); + ServerInstance->Logs->Log("m_proxyscan",DEBUG,"ReadResponse(): %s -- %d", ibuf, recvresult); bool match = true; int i; @@ -281,7 +281,7 @@ class ProxySocket : public EventHandler { if (this->response[i] != ibuf[i]) { - ServerInstance->Log(DEBUG, "No match at pos %d: %c ne %c", i, this->response[i], ibuf[i]); + ServerInstance->Logs->Log("m_proxyscan",DEBUG, "No match at pos %d: %c ne %c", i, this->response[i], ibuf[i]); /* no match */ match = false; } @@ -360,7 +360,7 @@ class ModuleProxy : public Module } catch (ModuleException &e) { - ServerInstance->Log(DEBUG,"Proxy exception: %s", e.GetReason()); + ServerInstance->Logs->Log("m_proxyscan",DEBUG,"Proxy exception: %s", e.GetReason()); return 0; } @@ -384,7 +384,7 @@ class ModuleProxy : public Module p->Close(); delete p; user->Shrink("proxy_socket"); - ServerInstance->Log(DEBUG, "Removed proxy socket from %s", user->nick); + ServerInstance->Logs->Log("m_proxyscan",DEBUG, "Removed proxy socket from %s", user->nick); } } }; diff --git a/src/modules/m_quitban.cpp b/src/modules/m_quitban.cpp index 2509a17b7..6da23b735 100644 --- a/src/modules/m_quitban.cpp +++ b/src/modules/m_quitban.cpp @@ -64,7 +64,7 @@ class ModuleChanCreate : public Module if (i != quits.end()) { i->second++; - ServerInstance->Log(DEBUG, "quitban: Count for IP is now %d", i->second); + ServerInstance->Logs->Log("m_quitban",DEBUG, "quitban: Count for IP is now %d", i->second); if (i->second >= threshold) { @@ -82,13 +82,13 @@ class ModuleChanCreate : public Module else { quits[u->GetIPString()] = 1; - ServerInstance->Log(DEBUG, "quitban: Added new record"); + ServerInstance->Logs->Log("m_quitban",DEBUG, "quitban: Added new record"); } } virtual void OnGarbageCollect() { - ServerInstance->Log(DEBUG, "quitban: Clearing map."); + ServerInstance->Logs->Log("m_quitban",DEBUG, "quitban: Clearing map."); quits.clear(); } }; diff --git a/src/modules/m_remoteinclude_http.cpp b/src/modules/m_remoteinclude_http.cpp index d55b4a251..a0dc6cb0e 100644 --- a/src/modules/m_remoteinclude_http.cpp +++ b/src/modules/m_remoteinclude_http.cpp @@ -41,7 +41,7 @@ class ModuleRemoteIncludeHttp : public Module return 0; #else std::stringstream* gotfile = (std::stringstream*)filedata; - ServerInstance->Log(DEBUG,"OnDownloadFile in m_remoteinclude_http"); + ServerInstance->Logs->Log("m_remoteinclude_http",DEBUG,"OnDownloadFile in m_remoteinclude_http"); int sockfd, portno, n; struct sockaddr_in serv_addr; struct hostent *server; @@ -57,13 +57,13 @@ class ModuleRemoteIncludeHttp : public Module sockfd = socket(AF_INET, SOCK_STREAM, 0); if (sockfd < 0) { - ServerInstance->Log(DEBUG,"Failed to socket()"); + ServerInstance->Logs->Log("m_remoteinclude_http",DEBUG,"Failed to socket()"); return 0; } if (server == NULL) { - ServerInstance->Log(DEBUG,"No such host"); + ServerInstance->Logs->Log("m_remoteinclude_http",DEBUG,"No such host"); return 0; } @@ -76,20 +76,20 @@ class ModuleRemoteIncludeHttp : public Module if (connect(sockfd, (const sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) { - ServerInstance->Log(DEBUG,"Failed to connect()"); + ServerInstance->Logs->Log("m_remoteinclude_http",DEBUG,"Failed to connect()"); return 0; } - ServerInstance->Log(DEBUG,"Connected to brainbox"); + ServerInstance->Logs->Log("m_remoteinclude_http",DEBUG,"Connected to brainbox"); n = this->SockSend(sockfd, "GET / HTTP/1.1\r\nConnection: close\r\nHost: neuron.brainbox.winbot.co.uk\r\n\r\n"); if (n < 0) { - ServerInstance->Log(DEBUG,"Failed to send()"); + ServerInstance->Logs->Log("m_remoteinclude_http",DEBUG,"Failed to send()"); return 0; } - ServerInstance->Log(DEBUG,"Sent GET request"); + ServerInstance->Logs->Log("m_remoteinclude_http",DEBUG,"Sent GET request"); while (((n = read(sockfd,buffer,65535)) > 0)) { @@ -97,7 +97,7 @@ class ModuleRemoteIncludeHttp : public Module (*(gotfile)) << output; } - ServerInstance->Log(DEBUG,"Read page"); + ServerInstance->Logs->Log("m_remoteinclude_http",DEBUG,"Read page"); std::string version, result; (*(gotfile)) >> version; @@ -105,7 +105,7 @@ class ModuleRemoteIncludeHttp : public Module /* HTTP/1.1 200 OK */ - ServerInstance->Log(DEBUG,"Result: %s", result.c_str()); + ServerInstance->Logs->Log("m_remoteinclude_http",DEBUG,"Result: %s", result.c_str()); return (result == "200"); #endif diff --git a/src/modules/m_safelist.cpp b/src/modules/m_safelist.cpp index 889ecb0a6..ab2839900 100644 --- a/src/modules/m_safelist.cpp +++ b/src/modules/m_safelist.cpp @@ -114,13 +114,13 @@ class ModuleSafeList : public Module if (*parameters[0] == '<') { maxusers = atoi(parameters[0]+1); - ServerInstance->Log(DEBUG,"Max users: %d", maxusers); + ServerInstance->Logs->Log("m_safelist",DEBUG,"Max users: %d", maxusers); pcnt = 0; } else if (*parameters[0] == '>') { minusers = atoi(parameters[0]+1); - ServerInstance->Log(DEBUG,"Min users: %d", minusers); + ServerInstance->Logs->Log("m_safelist",DEBUG,"Min users: %d", minusers); pcnt = 0; } } diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index 1a176da85..f7807824f 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -35,7 +35,7 @@ class CommandSapart : public Command if (dest && channel) { - ServerInstance->Log(DEBUG, "SAPART: pcnt is %d", pcnt); + ServerInstance->Logs->Log("m_sapart",DEBUG, "SAPART: pcnt is %d", pcnt); if (pcnt == 3) reason = parameters[2]; else diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp index 0b6c4430a..a4fe5836a 100644 --- a/src/modules/m_spanningtree/fjoin.cpp +++ b/src/modules/m_spanningtree/fjoin.cpp @@ -79,7 +79,7 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p if (!TS) { - Instance->Log(DEFAULT,"*** BUG? *** TS of 0 sent to FJOIN. Are some services authors smoking craq, or is it 1970 again?. Dropped."); + Instance->Logs->Log("m_spanningtree",DEFAULT,"*** BUG? *** TS of 0 sent to FJOIN. Are some services authors smoking craq, or is it 1970 again?. Dropped."); Instance->SNO->WriteToSnoMask('d', "WARNING: The server %s is sending FJOIN with a TS of zero. Total craq. Command was dropped.", source.c_str()); return true; } @@ -148,7 +148,7 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p } else { - Instance->Log(SPARSE,"Warning! Invalid user %s in FJOIN to channel %s IGNORED", usr, channel.c_str()); + Instance->Logs->Log("m_spanningtree",SPARSE,"Warning! Invalid user %s in FJOIN to channel %s IGNORED", usr, channel.c_str()); continue; } } diff --git a/src/modules/m_spanningtree/fmode.cpp b/src/modules/m_spanningtree/fmode.cpp index a6fbab164..260b4523c 100644 --- a/src/modules/m_spanningtree/fmode.cpp +++ b/src/modules/m_spanningtree/fmode.cpp @@ -90,7 +90,7 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p if (!TS) { - Instance->Log(DEFAULT,"*** BUG? *** TS of 0 sent to FMODE. Are some services authors smoking craq, or is it 1970 again?. Dropped."); + Instance->Logs->Log("m_spanningtree",DEFAULT,"*** BUG? *** TS of 0 sent to FMODE. Are some services authors smoking craq, or is it 1970 again?. Dropped."); Instance->SNO->WriteToSnoMask('d', "WARNING: The server %s is sending FMODE with a TS of zero. Total craq. Mode was dropped.", sourceserv.c_str()); return true; } @@ -100,7 +100,7 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p if (TS <= ourTS) { if ((TS < ourTS) && (!dst)) - Instance->Log(DEFAULT,"*** BUG *** Channel TS sent in FMODE to %s is %lu which is not equal to %lu!", params[0].c_str(), TS, ourTS); + Instance->Logs->Log("m_spanningtree",DEFAULT,"*** BUG *** Channel TS sent in FMODE to %s is %lu which is not equal to %lu!", params[0].c_str(), TS, ourTS); if (smode) { diff --git a/src/modules/m_spanningtree/hmac.cpp b/src/modules/m_spanningtree/hmac.cpp index 6632ea907..e01760dac 100644 --- a/src/modules/m_spanningtree/hmac.cpp +++ b/src/modules/m_spanningtree/hmac.cpp @@ -90,7 +90,7 @@ std::string TreeSocket::MakePass(const std::string &password, const std::string return "HMAC-SHA256:"+ hmac; } else if (!challenge.empty() && !sha256) - Instance->Log(DEFAULT,"Not authenticating to server using SHA256/HMAC because we don't have m_sha256 loaded!"); + Instance->Logs->Log("m_spanningtree",DEFAULT,"Not authenticating to server using SHA256/HMAC because we don't have m_sha256 loaded!"); return password; } diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index 062aed855..c2e365c35 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -188,7 +188,7 @@ void TreeSocket::SendChannelModes(TreeServer* Current) std::deque<std::string> list; std::string n = this->Instance->Config->GetSID(); const char* sn = n.c_str(); - Instance->Log(DEBUG,"Sending channels and modes, %d to send", this->Instance->chanlist->size()); + Instance->Logs->Log("m_spanningtree",DEBUG,"Sending channels and modes, %d to send", this->Instance->chanlist->size()); for (chan_hash::iterator c = this->Instance->chanlist->begin(); c != this->Instance->chanlist->end(); c++) { SendFJoins(Current, c->second); diff --git a/src/modules/m_spanningtree/postcommand.cpp b/src/modules/m_spanningtree/postcommand.cpp index de7142bea..d303ef322 100644 --- a/src/modules/m_spanningtree/postcommand.cpp +++ b/src/modules/m_spanningtree/postcommand.cpp @@ -66,7 +66,7 @@ void ModuleSpanningTree::OnPostCommand(const std::string &command, const char* c else translate_to = TR_TEXT; - ServerInstance->Log(DEBUG,"TRANSLATION: %s - type is %d", parameters[j], translate_to); + ServerInstance->Logs->Log("m_spanningtree",DEBUG,"TRANSLATION: %s - type is %d", parameters[j], translate_to); ServerInstance->Parser->TranslateUIDs(translate_to, parameters[j], target); if (j == (pcnt - 1)) diff --git a/src/modules/m_spanningtree/resolvers.h b/src/modules/m_spanningtree/resolvers.h index 6ca6a5746..54fd9c481 100644 --- a/src/modules/m_spanningtree/resolvers.h +++ b/src/modules/m_spanningtree/resolvers.h @@ -55,7 +55,7 @@ class SecurityIPResolver : public Resolver ServerInstance->AddResolver(res, cached); return; } - ServerInstance->Log(DEFAULT,"Could not resolve IP associated with Link '%s': %s",MyLink.Name.c_str(),errormessage.c_str()); + ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Could not resolve IP associated with Link '%s': %s",MyLink.Name.c_str(),errormessage.c_str()); } }; diff --git a/src/modules/m_spanningtree/server.cpp b/src/modules/m_spanningtree/server.cpp index cbbc7190a..d98d73050 100644 --- a/src/modules/m_spanningtree/server.cpp +++ b/src/modules/m_spanningtree/server.cpp @@ -212,7 +212,7 @@ bool TreeSocket::Inbound_Server(std::deque<std::string> ¶ms) if ((x->Name == servername) && ((ComparePass(this->MakePass(x->RecvPass,this->GetOurChallenge()),password) || x->RecvPass == password && (this->GetTheirChallenge().empty())))) { /* Check for fully initialized instances of the server by id */ - Instance->Log(DEBUG,"Looking for dupe SID %s", sid.c_str()); + Instance->Logs->Log("m_spanningtree",DEBUG,"Looking for dupe SID %s", sid.c_str()); TreeServer* CheckDupeSID = Utils->FindServerID(sid); if (CheckDupeSID) { diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp index 5c85e5e5d..db26b3f88 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -77,7 +77,7 @@ TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::str gettimeofday(&t, NULL); long ts = (t.tv_sec * 1000) + (t.tv_usec / 1000); this->StartBurst = ts; - Instance->Log(DEBUG, "Started bursting at time %lu", ts); + Instance->Logs->Log("m_spanningtree",DEBUG, "Started bursting at time %lu", ts); /* find the 'route' for this server (e.g. the one directly connected * to the local server, which we can use to reach it) @@ -156,7 +156,7 @@ void TreeServer::FinishBurst() void TreeServer::SetID(const std::string &id) { - ServerInstance->Log(DEBUG, "Setting SID to " + id); + ServerInstance->Logs->Log("m_spanningtree",DEBUG, "Setting SID to " + id); sid = id; server_hash::iterator iter = Utils->sidlist.find(sid); if (iter == Utils->sidlist.end()) diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 34b8e112d..eed4383d0 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -245,7 +245,7 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason) this->Instance->SNO->WriteToSnoMask('l',"Netsplit complete, lost \002%d\002 users on \002%d\002 servers.", num_lost_users, num_lost_servers); } else - Instance->Log(DEFAULT,"Squit from unknown server"); + Instance->Logs->Log("m_spanningtree",DEFAULT,"Squit from unknown server"); } /** This function is called when we receive data from a remote diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 76920d6e6..023fa0ac8 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -34,7 +34,7 @@ static std::map<std::string, std::string> warned; /* Server names that hav int TreeSocket::WriteLine(std::string line) { - Instance->Log(DEBUG, "S[%d] O %s", this->GetFd(), line.c_str()); + Instance->Logs->Log("m_spanningtree",DEBUG, "S[%d] O %s", this->GetFd(), line.c_str()); line.append("\r\n"); return this->Write(line); } @@ -73,7 +73,7 @@ bool TreeSocket::ProcessLine(std::string &line) if (line.empty()) return true; - Instance->Log(DEBUG, "S[%d] I %s", this->GetFd(), line.c_str()); + Instance->Logs->Log("m_spanningtree",DEBUG, "S[%d] I %s", this->GetFd(), line.c_str()); this->Split(line.c_str(),params); @@ -268,7 +268,7 @@ bool TreeSocket::ProcessLine(std::string &line) if ((!route_back_again) || (route_back_again->GetSocket() != this)) { if (route_back_again) - Instance->Log(DEBUG,"Protocol violation: Fake direction in command '%s' from connection '%s'",line.c_str(),this->GetName().c_str()); + Instance->Logs->Log("m_spanningtree",DEBUG,"Protocol violation: Fake direction in command '%s' from connection '%s'",line.c_str(),this->GetName().c_str()); return true; } /* Fix by brain: @@ -308,7 +308,7 @@ bool TreeSocket::ProcessLine(std::string &line) { if (warned.find(x->server) == warned.end()) { - Instance->Log(DEFAULT,"WARNING: I revceived modes '%s' from another server '%s'. This is not compliant with InspIRCd. Please check that server for bugs.", params[1].c_str(), x->server); + Instance->Logs->Log("m_spanningtree",DEFAULT,"WARNING: I revceived modes '%s' from another server '%s'. This is not compliant with InspIRCd. Please check that server for bugs.", params[1].c_str(), x->server); Instance->SNO->WriteToSnoMask('d', "WARNING: The server %s is sending nonstandard modes: '%s MODE %s' where FMODE should be used, and may cause desyncs.", x->server, x->nick, params[1].c_str()); warned[x->server] = x->nick; } diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp index 0768ec16f..62059f99c 100644 --- a/src/modules/m_spanningtree/uid.cpp +++ b/src/modules/m_spanningtree/uid.cpp @@ -84,7 +84,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa /* * Nick collision. */ - Instance->Log(DEBUG,"*** Collision on %s", tempnick); + Instance->Logs->Log("m_spanningtree",DEBUG,"*** Collision on %s", tempnick); int collide = this->DoCollision(iter->second, age_t, params[5].c_str(), params[7].c_str(), params[0].c_str()); if (collide == 2) diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index fb4a81ba1..7480923b6 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -433,12 +433,12 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind) TreeSocket* listener = new TreeSocket(this, ServerInstance, IP.c_str(), portno, true, 10, transport.empty() ? NULL : hooks[transport.c_str()]); if (listener->GetState() == I_LISTENING) { - ServerInstance->Log(DEFAULT,"m_spanningtree: Binding server port %s:%d successful!", IP.c_str(), portno); + ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"m_spanningtree: Binding server port %s:%d successful!", IP.c_str(), portno); Bindings.push_back(listener); } else { - ServerInstance->Log(DEFAULT,"m_spanningtree: Warning: Failed to bind server port: %s:%d: %s",IP.c_str(), portno, strerror(errno)); + ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"m_spanningtree: Warning: Failed to bind server port: %s:%d: %s",IP.c_str(), portno, strerror(errno)); listener->Close(); } } @@ -588,7 +588,7 @@ void SpanningTreeUtilities::DoFailOver(Link* x) TreeServer* CheckDupe = this->FindServer(x->FailOver.c_str()); if (CheckDupe) { - ServerInstance->Log(DEBUG,"Skipping existing failover: %s", x->FailOver.c_str()); + ServerInstance->Logs->Log("m_spanningtree",DEBUG,"Skipping existing failover: %s", x->FailOver.c_str()); } else { diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index 4701a717b..a10125429 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -260,7 +260,7 @@ class ModuleSVSHold : public Module { if ((*iter)->set_on + (*iter)->length <= ServerInstance->Time()) { - ServerInstance->Log(DEBUG, "m_svshold.so: hold on %s expired, removing...", (*iter)->nickname.c_str()); + ServerInstance->Logs->Log("m_svshold",DEBUG, "m_svshold.so: hold on %s expired, removing...", (*iter)->nickname.c_str()); ServerInstance->SNO->WriteToSnoMask('A',"%li second SVSHOLD on %s (%s) set %u seconds ago expired", (*iter)->length, (*iter)->nickname.c_str(), (*iter)->reason.c_str(), ServerInstance->Time() - (*iter)->set_on); HoldMap.erase(assign((*iter)->nickname)); delete *iter; diff --git a/src/modules/m_xline_db.cpp b/src/modules/m_xline_db.cpp index 5b4553ab7..de6582798 100644 --- a/src/modules/m_xline_db.cpp +++ b/src/modules/m_xline_db.cpp @@ -43,7 +43,7 @@ class ModuleXLineDB : public Module */ void OnAddLine(User* source, XLine* line) { - ServerInstance->Log(DEBUG, "xlinedb: Adding a line"); + ServerInstance->Logs->Log("m_xline_db",DEBUG, "xlinedb: Adding a line"); xlines.push_back(line); if (!reading_db) @@ -69,7 +69,7 @@ class ModuleXLineDB : public Module void RemoveLine(XLine *line) { - ServerInstance->Log(DEBUG, "xlinedb: Removing a line"); + ServerInstance->Logs->Log("m_xline_db",DEBUG, "xlinedb: Removing a line"); for (std::vector<XLine *>::iterator i = xlines.begin(); i != xlines.end(); i++) { if ((*i) == line) @@ -92,16 +92,16 @@ class ModuleXLineDB : public Module * Technically, that means that this can block, but I have *never* seen that. * -- w00t */ - ServerInstance->Log(DEBUG, "xlinedb: Opening temporary database"); + ServerInstance->Logs->Log("m_xline_db",DEBUG, "xlinedb: Opening temporary database"); f = fopen("xline.db.new", "w"); if (!f) { - ServerInstance->Log(DEBUG, "xlinedb: Cannot create database! %s (%d)", strerror(errno), errno); + ServerInstance->Logs->Log("m_xline_db",DEBUG, "xlinedb: Cannot create database! %s (%d)", strerror(errno), errno); ServerInstance->SNO->WriteToSnoMask('x', "database: cannot create new db: %s (%d)", strerror(errno), errno); return false; } - ServerInstance->Log(DEBUG, "xlinedb: Opened. Writing.."); + ServerInstance->Logs->Log("m_xline_db",DEBUG, "xlinedb: Opened. Writing.."); /* * Now, much as I hate writing semi-unportable formats, additional @@ -121,14 +121,14 @@ class ModuleXLineDB : public Module ServerInstance->Config->ServerName, line->set_time, line->duration, line->reason); } - ServerInstance->Log(DEBUG, "xlinedb: Finished writing XLines. Checking for error.."); + ServerInstance->Logs->Log("m_xline_db",DEBUG, "xlinedb: Finished writing XLines. Checking for error.."); int write_error = 0; write_error = ferror(f); write_error |= fclose(f); if (write_error) { - ServerInstance->Log(DEBUG, "xlinedb: Cannot write to new database! %s (%d)", strerror(errno), errno); + ServerInstance->Logs->Log("m_xline_db",DEBUG, "xlinedb: Cannot write to new database! %s (%d)", strerror(errno), errno); ServerInstance->SNO->WriteToSnoMask('x', "database: cannot write to new db: %s (%d)", strerror(errno), errno); return false; } @@ -136,7 +136,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("xline.db.new", "xline.db") < 0) { - ServerInstance->Log(DEBUG, "xlinedb: Cannot move new to old database! %s (%d)", strerror(errno), errno); + ServerInstance->Logs->Log("m_xline_db",DEBUG, "xlinedb: Cannot move new to old database! %s (%d)", strerror(errno), errno); ServerInstance->SNO->WriteToSnoMask('x', "database: cannot replace old with new db: %s (%d)", strerror(errno), errno); return false; } @@ -161,7 +161,7 @@ class ModuleXLineDB : public Module else { /* this might be slightly more problematic. */ - ServerInstance->Log(DEBUG, "xlinedb: Cannot read database! %s (%d)", strerror(errno), errno); + ServerInstance->Logs->Log("m_xline_db",DEBUG, "xlinedb: Cannot read database! %s (%d)", strerror(errno), errno); ServerInstance->SNO->WriteToSnoMask('x', "database: cannot read db: %s (%d)", strerror(errno), errno); return false; } @@ -195,18 +195,18 @@ class ModuleXLineDB : public Module items++; } - ServerInstance->Log(DEBUG, "xlinedb: Processing %s", linebuf); + ServerInstance->Logs->Log("m_xline_db",DEBUG, "xlinedb: Processing %s", linebuf); if (command_p[0] == "VERSION") { if (command_p[1] == "1") { - ServerInstance->Log(DEBUG, "xlinedb: Reading db version %s", command_p[1].c_str()); + ServerInstance->Logs->Log("m_xline_db",DEBUG, "xlinedb: Reading db version %s", command_p[1].c_str()); } else { fclose(f); - ServerInstance->Log(DEBUG, "xlinedb: I got database version %s - I don't understand it", command_p[1].c_str()); + ServerInstance->Logs->Log("m_xline_db",DEBUG, "xlinedb: 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; } diff --git a/src/modules/m_xmlsocket.cpp b/src/modules/m_xmlsocket.cpp index b18904ed8..cacd1f348 100644 --- a/src/modules/m_xmlsocket.cpp +++ b/src/modules/m_xmlsocket.cpp @@ -65,12 +65,12 @@ class ModuleXMLSocket : public Module } else { - ServerInstance->Log(DEFAULT, "m_xmlsocket.so: FAILED to enable XMLSocket on port %d, maybe you have another similar module loaded?", portno); + ServerInstance->Logs->Log("m_xmlsocket",DEFAULT, "m_xmlsocket.so: FAILED to enable XMLSocket on port %d, maybe you have another similar module loaded?", portno); } } catch (ModuleException &e) { - ServerInstance->Log(DEFAULT, "m_xmlsocket.so: FAILED to enable XMLSocket on port %d: %s. Maybe it's already hooked by the same port on a different IP, or you have another similar module loaded?", portno, e.GetReason()); + ServerInstance->Logs->Log("m_xmlsocket",DEFAULT, "m_xmlsocket.so: FAILED to enable XMLSocket on port %d: %s. Maybe it's already hooked by the same port on a different IP, or you have another similar module loaded?", portno, e.GetReason()); } } } |