]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Convert remaining InspIRCd::Log() calls to new logging system
authoraquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 22 Feb 2008 16:47:10 +0000 (16:47 +0000)
committeraquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 22 Feb 2008 16:47:10 +0000 (16:47 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9001 e03df62e-2008-0410-955e-edbf42e46eb7

67 files changed:
include/modules.h
src/channels.cpp
src/command_parse.cpp
src/commands/cmd_die.cpp
src/commands/cmd_kill.cpp
src/commands/cmd_oper.cpp
src/commands/cmd_restart.cpp
src/commands/cmd_whowas.cpp
src/configreader.cpp
src/cull_list.cpp
src/dns.cpp
src/helperfuncs.cpp
src/inspircd.cpp
src/inspsocket.cpp
src/mode.cpp
src/modes/cmode_b.cpp
src/modules.cpp
src/modules/extra/m_filter_pcre.cpp
src/modules/extra/m_mysql.cpp
src/modules/extra/m_pgsql.cpp
src/modules/extra/m_rline.cpp
src/modules/extra/m_sqlite3.cpp
src/modules/extra/m_sqloper.cpp
src/modules/extra/m_sqlutils.cpp
src/modules/extra/m_ssl_gnutls.cpp
src/modules/extra/m_ssl_openssl.cpp
src/modules/extra/m_ssl_oper_cert.cpp
src/modules/m_blockcaps.cpp
src/modules/m_cgiirc.cpp
src/modules/m_filter.h
src/modules/m_foobar.cpp
src/modules/m_http_client.cpp
src/modules/m_httpd.cpp
src/modules/m_ident.cpp
src/modules/m_operlog.cpp
src/modules/m_password_hash.cpp
src/modules/m_proxyscan.cpp
src/modules/m_quitban.cpp
src/modules/m_remoteinclude_http.cpp
src/modules/m_safelist.cpp
src/modules/m_sapart.cpp
src/modules/m_spanningtree/fjoin.cpp
src/modules/m_spanningtree/fmode.cpp
src/modules/m_spanningtree/hmac.cpp
src/modules/m_spanningtree/netburst.cpp
src/modules/m_spanningtree/postcommand.cpp
src/modules/m_spanningtree/resolvers.h
src/modules/m_spanningtree/server.cpp
src/modules/m_spanningtree/treeserver.cpp
src/modules/m_spanningtree/treesocket1.cpp
src/modules/m_spanningtree/treesocket2.cpp
src/modules/m_spanningtree/uid.cpp
src/modules/m_spanningtree/utils.cpp
src/modules/m_svshold.cpp
src/modules/m_xline_db.cpp
src/modules/m_xmlsocket.cpp
src/socket.cpp
src/socketengines/socketengine_epoll.cpp
src/socketengines/socketengine_iocp.cpp
src/socketengines/socketengine_kqueue.cpp
src/socketengines/socketengine_ports.cpp
src/socketengines/socketengine_select.cpp
src/user_resolver.cpp
src/usermanager.cpp
src/userprocess.cpp
src/users.cpp
src/xline.cpp

index 9498e239e6027f3cd0afb16377138823c4dc3307..35c439a10d6febe67eadc800fdedb3415b3624ed 100644 (file)
@@ -135,7 +135,7 @@ typedef std::map<std::string, std::pair<int, modulelist> > interfacelist;
                } \
                catch (CoreException& modexcept) \
                { \
-                       ServerInstance->Log(DEFAULT,"Exception caught: %s",modexcept.GetReason()); \
+                       ServerInstance->Logs->Log("MODULE",DEFAULT,"Exception caught: %s",modexcept.GetReason()); \
                } \
                _i = safei; \
        } \
@@ -159,7 +159,7 @@ typedef std::map<std::string, std::pair<int, modulelist> > interfacelist;
                } \
                catch (CoreException& modexcept) \
                { \
-                       z->Log(DEFAULT,"Exception caught: %s",modexcept.GetReason()); \
+                       z->Logs->Log("MODULE",DEFAULT,"Exception caught: %s",modexcept.GetReason()); \
                } \
                _i = safei; \
        } \
@@ -188,7 +188,7 @@ do { \
                } \
                catch (CoreException& modexcept) \
                { \
-                       ServerInstance->Log(DEFAULT,"Exception caught: %s",modexcept.GetReason()); \
+                       ServerInstance->Logs->Log("MODULE",DEFAULT,"Exception caught: %s",modexcept.GetReason()); \
                } \
                _i = safei; \
        } \
@@ -218,7 +218,7 @@ do { \
                } \
                catch (CoreException& modexcept) \
                { \
-                       z->Log(DEBUG,"Exception caught: %s",modexcept.GetReason()); \
+                       z->Logs->Log("MODULE",DEBUG,"Exception caught: %s",modexcept.GetReason()); \
                } \
                _i = safei; \
        } \
index 793bfb4291761f22e048e6885e5719eccf887571..c90a8f4e5881d337a1ef76e720f9bf066241d47d 100644 (file)
@@ -267,7 +267,7 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool
                if (!IS_LOCAL(user))
                {
                        if (!TS)
-                               Instance->Log(DEBUG,"*** BUG *** Channel::JoinUser called for REMOTE user '%s' on channel '%s' but no TS given!", user->nick, cn);
+                               Instance->Logs->Log("CHANNEL",DEBUG,"*** BUG *** Channel::JoinUser called for REMOTE user '%s' on channel '%s' but no TS given!", user->nick, cn);
                }
                else
                {
index 57a86b0cde18b1e0a42ffd0e87c08118aef2b9da..d8e59e0c047f2fad1dd2814caf2b8923db24fb31 100644 (file)
@@ -426,7 +426,7 @@ bool CommandParser::CreateCommand(Command *f, void* so_handle)
                        RFCCommands[f->command] = so_handle;
                else
                {
-                       ServerInstance->Log(DEFAULT,"ERK! Somehow, we loaded a cmd_*.so file twice! Only the first instance is being recorded.");
+                       ServerInstance->Logs->Log("COMMAND",DEFAULT,"ERK! Somehow, we loaded a cmd_*.so file twice! Only the first instance is being recorded.");
                        return false;
                }
        }
@@ -451,7 +451,7 @@ bool CommandParser::FindSym(void** v, void* h, const std::string &name)
        const char* err = dlerror();
        if (err && !(*v))
        {
-               ServerInstance->Log(SPARSE, "Error loading core command %s: %s\n", name.c_str(), err);
+               ServerInstance->Logs->Log("COMMAND",SPARSE, "Error loading core command %s: %s\n", name.c_str(), err);
                return false;
        }
        return true;
@@ -523,7 +523,7 @@ const char* CommandParser::LoadCommand(const char* name)
        /* Command already exists? Succeed silently - this is needed for REHASH */
        if (RFCCommands.find(name) != RFCCommands.end())
        {
-               ServerInstance->Log(DEBUG,"Not reloading command %s/%s, it already exists", LIBRARYDIR, name);
+               ServerInstance->Logs->Log("COMMAND",DEBUG,"Not reloading command %s/%s, it already exists", LIBRARYDIR, name);
                return NULL;
        }
 
@@ -533,7 +533,7 @@ const char* CommandParser::LoadCommand(const char* name)
        if (!h)
        {
                const char* n = dlerror();
-               ServerInstance->Log(SPARSE, "Error loading core command %s: %s", name, n);
+               ServerInstance->Logs->Log("COMMAND",SPARSE, "Error loading core command %s: %s", name, n);
                return n;
        }
 
index 960cefe634946e888597c2f9b95c5a51b2e67fa3..761127dcbcc94f248ae85e5625ebc5689bdd99ff 100644 (file)
@@ -27,7 +27,7 @@ CmdResult CommandDie::Handle (const char* const* parameters, int pcnt, User *use
        if (!ServerInstance->PassCompare(user, ServerInstance->Config->diepass, parameters[0], ServerInstance->Config->powerhash))
        {
                std::string diebuf = std::string("*** DIE command from ") + user->nick + "!" + user->ident + "@" + user->dhost + ". Terminating in " + ConvToStr(ServerInstance->Config->DieDelay) + " seconds.";
-               ServerInstance->Log(SPARSE, diebuf);
+               ServerInstance->Logs->Log("COMMAND",SPARSE, diebuf);
                ServerInstance->SendError(diebuf);
                
                if (ServerInstance->Config->DieDelay)
@@ -37,7 +37,7 @@ CmdResult CommandDie::Handle (const char* const* parameters, int pcnt, User *use
        }
        else
        {
-               ServerInstance->Log(SPARSE, "Failed /DIE command from %s!%s@%s", user->nick, user->ident, user->host);
+               ServerInstance->Logs->Log("COMMAND",SPARSE, "Failed /DIE command from %s!%s@%s", user->nick, user->ident, user->host);
                ServerInstance->SNO->WriteToSnoMask('A', "Failed DIE Command from %s!%s@%s.",user->nick,user->ident,user->host);
                return CMD_FAILURE;
        }
index c92b8a6b0b7094837e64c644ee1f00851bfc3531..72aee4d1d5dad6cd8562914759ce0494e5e32525 100644 (file)
@@ -86,7 +86,7 @@ CmdResult CommandKill::Handle (const char* const* parameters, int pcnt, User *us
                         * snotices, C will get a local kill snotice. this isn't accurate, and needs fixing at some stage. -- w00t
                         */
                        ServerInstance->SNO->WriteToSnoMask('k',"Local Kill by %s: %s!%s@%s (%s)", user->nick, u->nick, u->ident, u->host, parameters[1]);
-                       ServerInstance->Log(DEFAULT,"LOCAL KILL: %s :%s!%s!%s (%s)", u->nick, ServerInstance->Config->ServerName, user->dhost, user->nick, parameters[1]);
+                       ServerInstance->Logs->Log("KILL",DEFAULT,"LOCAL KILL: %s :%s!%s!%s (%s)", u->nick, ServerInstance->Config->ServerName, user->dhost, user->nick, parameters[1]);
                        /* Bug #419, make sure this message can only occur once even in the case of multiple KILL messages crossing the network, and change to show
                         * hidekillsserver as source if possible
                         */
index 608d04ba639d5ccf8ecb4e60024e08f4cb949478..4acf883296b7c1050c08715975b21b5047c962d1 100644 (file)
@@ -84,7 +84,7 @@ CmdResult CommandOper::Handle (const char* const* parameters, int, User *user)
                                        {
                                                user->WriteServ("491 %s :Invalid oper type (oper types must follow the same syntax as nicknames)",user->nick);
                                                ServerInstance->SNO->WriteToSnoMask('o',"CONFIGURATION ERROR! Oper type '%s' contains invalid characters",OperType);
-                                               ServerInstance->Log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but oper type erroneous.",user->nick,user->ident,user->host);
+                                               ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but oper type erroneous.",user->nick,user->ident,user->host);
                                                return CMD_FAILURE;
                                        }
                                        ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "type","host", j, HostName, MAXBUF);
@@ -141,7 +141,7 @@ CmdResult CommandOper::Handle (const char* const* parameters, int, User *user)
                        Event rmode2((char *)&n, NULL, "send_snoset");
                        rmode2.Send(ServerInstance);
 
-                       ServerInstance->Log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': The following fields did not match: %s",user->nick,user->ident,user->host,parameters[0],fields.c_str());
+                       ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': The following fields did not match: %s",user->nick,user->ident,user->host,parameters[0],fields.c_str());
                        return CMD_FAILURE;
                }
                else
@@ -155,7 +155,7 @@ CmdResult CommandOper::Handle (const char* const* parameters, int, User *user)
                        Event rmode2((char *)&n, NULL, "send_snoset");
                        rmode2.Send(ServerInstance);
 
-                       ServerInstance->Log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': credentials valid, but oper type nonexistent.",user->nick,user->ident,user->host,parameters[0]);
+                       ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': credentials valid, but oper type nonexistent.",user->nick,user->ident,user->host,parameters[0]);
                        return CMD_FAILURE;
                }
        }
index 379052a1ea798e1fb24ab6a96d0272b7ad893bce..cc634d860280e2856aab4f43ff5dcfec8cd2279e 100644 (file)
@@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance)
 
 CmdResult CommandRestart::Handle (const char* const* parameters, int, User *user)
 {
-       ServerInstance->Log(DEFAULT,"Restart: %s",user->nick);
+       ServerInstance->Logs->Log("COMMAND",DEFAULT,"Restart: %s",user->nick);
        if (!ServerInstance->PassCompare(user, ServerInstance->Config->restartpass, parameters[0], ServerInstance->Config->powerhash))
        {
                ServerInstance->SNO->WriteToSnoMask('A', "RESTART command from %s!%s@%s, restarting server.",user->nick,user->ident,user->host);
index fd9544853c5e560f70aec924121b7bf2cd15f5a2..cece27670bb90789358aa8528f827d93b20abfbd 100644 (file)
@@ -207,7 +207,7 @@ void CommandWhowas::PruneWhoWas(time_t t)
                        if (iter == whowas.end())
                        {
                                /* this should never happen, if it does maps are corrupt */
-                               ServerInstance->Log(DEFAULT, "BUG: Whowas maps got corrupted! (1)");
+                               ServerInstance->Logs->Log("WHOWAS",DEFAULT, "BUG: Whowas maps got corrupted! (1)");
                                return;
                        }
 
@@ -240,7 +240,7 @@ void CommandWhowas::PruneWhoWas(time_t t)
                if (iter == whowas.end())
                {
                        /* this should never happen, if it does maps are corrupt */
-                       ServerInstance->Log(DEFAULT, "BUG: Whowas maps got corrupted! (2)");
+                       ServerInstance->Logs->Log("WHOWAS",DEFAULT, "BUG: Whowas maps got corrupted! (2)");
                        return;
                }
                whowas_set* n = (whowas_set*)iter->second;
@@ -293,7 +293,7 @@ CommandWhowas::~CommandWhowas()
                if (iter == whowas.end())
                {
                        /* this should never happen, if it does maps are corrupt */
-                       ServerInstance->Log(DEFAULT, "BUG: Whowas maps got corrupted! (3)");
+                       ServerInstance->Logs->Log("WHOWAS",DEFAULT, "BUG: Whowas maps got corrupted! (3)");
                        return;
                }
 
index e0dd021ba163611046547e485bf525d3d151c25d..92d2c9aead1df02986a1d17ba5875319417cfa39 100644 (file)
@@ -284,7 +284,7 @@ bool ValidateMaxTargets(ServerConfig* conf, const char*, const char*, ValueItem
 {
        if ((data.GetInteger() < 0) || (data.GetInteger() > 31))
        {
-               conf->GetInstance()->Log(DEFAULT,"WARNING: <options:maxtargets> value is greater than 31 or less than 0, set to 20.");
+               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"WARNING: <options:maxtargets> value is greater than 31 or less than 0, set to 20.");
                data.Set(20);
        }
        return true;
@@ -294,7 +294,7 @@ bool ValidateSoftLimit(ServerConfig* conf, const char*, const char*, ValueItem &
 {
        if ((data.GetInteger() < 1) || (data.GetInteger() > MAXCLIENTS))
        {
-               conf->GetInstance()->Log(DEFAULT,"WARNING: <options:softlimit> value is greater than %d or less than 0, set to %d.",MAXCLIENTS,MAXCLIENTS);
+               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"WARNING: <options:softlimit> value is greater than %d or less than 0, set to %d.",MAXCLIENTS,MAXCLIENTS);
                data.Set(MAXCLIENTS);
        }
        return true;
@@ -303,7 +303,7 @@ bool ValidateSoftLimit(ServerConfig* conf, const char*, const char*, ValueItem &
 bool ValidateMaxConn(ServerConfig* conf, const char*, const char*, ValueItem &data)
 {
        if (data.GetInteger() > SOMAXCONN)
-               conf->GetInstance()->Log(DEFAULT,"WARNING: <options:somaxconn> value may be higher than the system-defined SOMAXCONN value!");
+               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"WARNING: <options:somaxconn> value may be higher than the system-defined SOMAXCONN value!");
        return true;
 }
 
@@ -334,7 +334,7 @@ bool ValidateDnsServer(ServerConfig* conf, const char*, const char*, ValueItem &
        {
                std::string nameserver;
                // attempt to look up their nameserver from /etc/resolv.conf
-               conf->GetInstance()->Log(DEFAULT,"WARNING: <dns:server> not defined, attempting to find working server in /etc/resolv.conf...");
+               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"WARNING: <dns:server> not defined, attempting to find working server in /etc/resolv.conf...");
                std::ifstream resolv("/etc/resolv.conf");
                bool found_server = false;
 
@@ -347,19 +347,19 @@ bool ValidateDnsServer(ServerConfig* conf, const char*, const char*, ValueItem &
                                        resolv >> nameserver;
                                        data.Set(nameserver.c_str());
                                        found_server = true;
-                                       conf->GetInstance()->Log(DEFAULT,"<dns:server> set to '%s' as first resolver in /etc/resolv.conf.",nameserver.c_str());
+                                       conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"<dns:server> set to '%s' as first resolver in /etc/resolv.conf.",nameserver.c_str());
                                }
                        }
 
                        if (!found_server)
                        {
-                               conf->GetInstance()->Log(DEFAULT,"/etc/resolv.conf contains no viable nameserver entries! Defaulting to nameserver '127.0.0.1'!");
+                               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"/etc/resolv.conf contains no viable nameserver entries! Defaulting to nameserver '127.0.0.1'!");
                                data.Set("127.0.0.1");
                        }
                }
                else
                {
-                       conf->GetInstance()->Log(DEFAULT,"/etc/resolv.conf can't be opened! Defaulting to nameserver '127.0.0.1'!");
+                       conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"/etc/resolv.conf can't be opened! Defaulting to nameserver '127.0.0.1'!");
                        data.Set("127.0.0.1");
                }
        }
@@ -377,7 +377,7 @@ bool ValidateServerName(ServerConfig* conf, const char*, const char*, ValueItem
        }
        if (!strchr(data.GetString(),'.'))
        {
-               conf->GetInstance()->Log(DEFAULT,"WARNING: <server:name> '%s' is not a fully-qualified domain name. Changed to '%s%c'",data.GetString(),data.GetString(),'.');
+               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"WARNING: <server:name> '%s' is not a fully-qualified domain name. Changed to '%s%c'",data.GetString(),data.GetString(),'.');
                std::string moo = std::string(data.GetString()).append(".");
                data.Set(moo.c_str());
        }
@@ -388,7 +388,7 @@ bool ValidateNetBufferSize(ServerConfig* conf, const char*, const char*, ValueIt
 {
        if ((!data.GetInteger()) || (data.GetInteger() > 65535) || (data.GetInteger() < 1024))
        {
-               conf->GetInstance()->Log(DEFAULT,"No NetBufferSize specified or size out of range, setting to default of 10240.");
+               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"No NetBufferSize specified or size out of range, setting to default of 10240.");
                data.Set(10240);
        }
        return true;
@@ -398,7 +398,7 @@ bool ValidateMaxWho(ServerConfig* conf, const char*, const char*, ValueItem &dat
 {
        if ((data.GetInteger() > 65535) || (data.GetInteger() < 1))
        {
-               conf->GetInstance()->Log(DEFAULT,"<options:maxwhoresults> size out of range, setting to default of 128.");
+               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"<options:maxwhoresults> size out of range, setting to default of 128.");
                data.Set(128);
        }
        return true;
@@ -501,7 +501,7 @@ bool ValidateWhoWas(ServerConfig* conf, const char*, const char*, ValueItem &dat
        if (conf->WhoWasMaxKeep < 3600)
        {
                conf->WhoWasMaxKeep = 3600;
-               conf->GetInstance()->Log(DEFAULT,"WARNING: <whowas:maxkeep> value less than 3600, setting to default 3600");
+               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"WARNING: <whowas:maxkeep> value less than 3600, setting to default 3600");
        }
 
        Command* whowas_command = conf->GetInstance()->Parser->GetHandler("WHOWAS");
@@ -518,13 +518,13 @@ bool ValidateWhoWas(ServerConfig* conf, const char*, const char*, ValueItem &dat
  */
 bool InitConnect(ServerConfig* conf, const char*)
 {
-       conf->GetInstance()->Log(DEFAULT,"Reading connect classes...");
+       conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"Reading connect classes...");
 
        for (ClassVector::iterator i = conf->Classes.begin(); i != conf->Classes.end(); i++)
        {
                ConnectClass *c = *i;
 
-               conf->GetInstance()->Log(DEBUG, "Address of class is %p", c);
+               conf->GetInstance()->Logs->Log("CONFIG",DEBUG, "Address of class is %p", c);
        }
 
        for (ClassVector::iterator i = conf->Classes.begin(); i != conf->Classes.end() ; )
@@ -534,7 +534,7 @@ bool InitConnect(ServerConfig* conf, const char*)
                /* only delete a class with refcount 0 */
                if (c->RefCount == 0)
                {
-                       conf->GetInstance()->Log(DEFAULT, "Removing connect class, refcount is 0!");
+                       conf->GetInstance()->Logs->Log("CONFIG",DEFAULT, "Removing connect class, refcount is 0!");
                        
                        /* This was causing a crash, because we'd set i to .begin() just here, but then the for loop's increment would
                         * set it to .begin() + 1. Which if it was already the last thing in the list, wasn't good.
@@ -588,12 +588,12 @@ bool DoConnect(ServerConfig* conf, const char*, char**, ValueList &values, int*)
                {
                        /* reenable class so users can be shoved into it :P */
                        cc->SetDisabled(false);
-                       conf->GetInstance()->Log(DEFAULT, "Not adding class, it already exists!");
+                       conf->GetInstance()->Logs->Log("CONFIG",DEFAULT, "Not adding class, it already exists!");
                        return true;
                } 
        }
 
-       conf->GetInstance()->Log(DEFAULT,"Adding a connect class!");
+       conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"Adding a connect class!");
 
        if (*parent)
        {
@@ -604,7 +604,7 @@ bool DoConnect(ServerConfig* conf, const char*, char**, ValueList &values, int*)
                for (; item != conf->Classes.end(); ++item)
                {
                        ConnectClass* cc = *item;
-                       conf->GetInstance()->Log(DEBUG,"Class: %s", cc->GetName().c_str());
+                       conf->GetInstance()->Logs->Log("CONFIG",DEBUG,"Class: %s", cc->GetName().c_str());
                        if (cc->GetName() == parent)
                        {
                                ConnectClass* newclass = new ConnectClass(name, cc);
@@ -640,7 +640,7 @@ bool DoConnect(ServerConfig* conf, const char*, char**, ValueList &values, int*)
  */
 bool DoneConnect(ServerConfig *conf, const char*)
 {
-       conf->GetInstance()->Log(DEFAULT, "Done adding connect classes!");
+       conf->GetInstance()->Logs->Log("CONFIG",DEFAULT, "Done adding connect classes!");
        return true;
 }
 
@@ -751,7 +751,7 @@ bool DoneMaxBans(ServerConfig*, const char*)
 
 void ServerConfig::ReportConfigError(const std::string &errormessage, bool bail, User* user)
 {
-       ServerInstance->Log(DEFAULT, "There were errors in your configuration file: %s", errormessage.c_str());
+       ServerInstance->Logs->Log("CONFIG",DEFAULT, "There were errors in your configuration file: %s", errormessage.c_str());
        if (bail)
        {
                /* Unneeded because of the ServerInstance->Log() aboive? */
@@ -1146,7 +1146,7 @@ void ServerConfig::Read(bool bail, User* user, int pass)
        }
 
        /** XXX END PASS **/
-       ServerInstance->Log(DEBUG,"End config pass %d", pass);
+       ServerInstance->Logs->Log("CONFIG",DEBUG,"End config pass %d", pass);
 
        if (pass == 0)
        {
@@ -1157,7 +1157,7 @@ void ServerConfig::Read(bool bail, User* user, int pass)
 
                if (pass == 0)
                {
-                       ServerInstance->Log(DEBUG, "Downloading configuration");
+                       ServerInstance->Logs->Log("CONFIG",DEBUG, "Downloading configuration");
 
                        TotalDownloaded = 0;
                        FileErrors = 0;
@@ -1189,7 +1189,7 @@ void ServerConfig::Read(bool bail, User* user, int pass)
        // write once here, to try it out and make sure its ok
        ServerInstance->WritePID(this->PID);
 
-       ServerInstance->Log(DEFAULT,"Done reading configuration file.");
+       ServerInstance->Logs->Log("CONFIG",DEFAULT,"Done reading configuration file.");
 
        /* If we're rehashing, let's load any new modules, and unload old ones
         */
@@ -1263,7 +1263,7 @@ void ServerConfig::Read(bool bail, User* user, int pass)
                }
        }
 
-       ServerInstance->Log(DEFAULT,"Successfully unloaded %lu of %lu modules and loaded %lu of %lu modules.",(unsigned long)rem,(unsigned long)removed_modules.size(),(unsigned long)add,(unsigned long)added_modules.size());
+       ServerInstance->Logs->Log("CONFIG",DEFAULT,"Successfully unloaded %lu of %lu modules and loaded %lu of %lu modules.",(unsigned long)rem,(unsigned long)removed_modules.size(),(unsigned long)add,(unsigned long)added_modules.size());
 
        if (user)
                user->WriteServ("NOTICE %s :*** Successfully rehashed server.", user->nick);
@@ -1274,7 +1274,7 @@ void ServerConfig::Read(bool bail, User* user, int pass)
 /* XXX: This can and will block! */
 void ServerConfig::DoDownloads()
 {
-       ServerInstance->Log(DEBUG,"In DoDownloads()");
+       ServerInstance->Logs->Log("CONFIG",DEBUG,"In DoDownloads()");
 
        /* Reads all local files into the IncludedFiles map, then initiates sockets for the remote ones */
        for (std::map<std::string, std::istream*>::iterator x = IncludedFiles.begin(); x != IncludedFiles.end(); ++x)
@@ -1282,7 +1282,7 @@ void ServerConfig::DoDownloads()
                if (CompletedFiles.find(x->first) != CompletedFiles.end())
                        continue;
 
-               ServerInstance->Log(DEBUG,"StartDownloads File: %s", x->first.c_str());
+               ServerInstance->Logs->Log("CONFIG",DEBUG,"StartDownloads File: %s", x->first.c_str());
 
                std::string file = x->first;
                if ((file[0] == '/') || (file.substr(0, 7) == "file://"))
@@ -1295,7 +1295,7 @@ void ServerConfig::DoDownloads()
                        std::ifstream* conf = new std::ifstream(file.c_str());
                        if (!conf->fail())
                        {
-                               ServerInstance->Log(DEBUG,"file:// schema file %s loaded OK", file.c_str());
+                               ServerInstance->Logs->Log("CONFIG",DEBUG,"file:// schema file %s loaded OK", file.c_str());
                                delete x->second;
                                x->second = conf;
                        }
@@ -1310,7 +1310,7 @@ void ServerConfig::DoDownloads()
                else
                {
                        /* Modules handle these */
-                       ServerInstance->Log(DEBUG,"Module-handled schema for %s", x->first.c_str());
+                       ServerInstance->Logs->Log("CONFIG",DEBUG,"Module-handled schema for %s", x->first.c_str());
 
                        /* For now, error it */
                        int MOD_RESULT = 0;
@@ -1350,7 +1350,7 @@ bool ServerConfig::LoadConf(ConfigDataHash &target, const char* filename, std::o
 
        if (scan_for_includes_only)
        {
-               ServerInstance->Log(DEBUG,"scan_for_includes_only set");
+               ServerInstance->Logs->Log("CONFIG",DEBUG,"scan_for_includes_only set");
                conf = scan_for_includes_only;
        }
 
@@ -1373,7 +1373,7 @@ bool ServerConfig::LoadConf(ConfigDataHash &target, const char* filename, std::o
                {
                        if (pass == 0)
                        {
-                               ServerInstance->Log(DEBUG,"Push include file %s onto map", filename);
+                               ServerInstance->Logs->Log("CONFIG",DEBUG,"Push include file %s onto map", filename);
                                /* First pass, we insert the file into a map, and just return true */
                                IncludedFiles.insert(std::make_pair(filename,new std::stringstream));
                                return true;
@@ -1381,7 +1381,7 @@ bool ServerConfig::LoadConf(ConfigDataHash &target, const char* filename, std::o
                        else
                        {
                                /* Second pass, look for the file in the map */
-                               ServerInstance->Log(DEBUG,"We are in the second pass, and %s is not in the map!", filename);
+                               ServerInstance->Logs->Log("CONFIG",DEBUG,"We are in the second pass, and %s is not in the map!", filename);
                                errorstream << "File " << filename << " could not be opened." << std::endl;
                                return false;
                        }
@@ -1401,7 +1401,7 @@ bool ServerConfig::LoadConf(ConfigDataHash &target, const char* filename, std::o
                }
        }
 
-       ServerInstance->Log(DEBUG,"Start to read conf %s %08lx", filename, conf);
+       ServerInstance->Logs->Log("CONFIG",DEBUG,"Start to read conf %s %08lx", filename, conf);
 
        /* Start reading characters... */
        while (conf->get(ch))
@@ -1779,7 +1779,7 @@ bool ServerConfig::ConfValue(ConfigDataHash &target, const std::string &tag, con
                        {
                                if ((!allow_linefeeds) && (j->second.find('\n') != std::string::npos))
                                {
-                                       ServerInstance->Log(DEFAULT, "Value of <" + tag + ":" + var+ "> contains a linefeed, and linefeeds in this value are not permitted -- stripped to spaces.");
+                                       ServerInstance->Logs->Log("CONFIG",DEFAULT, "Value of <" + tag + ":" + var+ "> contains a linefeed, and linefeeds in this value are not permitted -- stripped to spaces.");
                                        for (std::string::iterator n = j->second.begin(); n != j->second.end(); n++)
                                                if (*n == '\n')
                                                        *n = ' ';
index b3fd1c9e382f7eae279db9c2870c081a2eac72dd..224591b6f82f5610f19439745781b41d47f4e722 100644 (file)
@@ -25,7 +25,7 @@ void CullList::AddItem(User* user)
 {
        if (user->quitting)
        {
-               ServerInstance->Log(DEBUG, "*** Warning *** - You tried to quit a user (%s) twice. Did your module call QuitUser twice?", user->nick);
+               ServerInstance->Logs->Log("CULLLIST",DEBUG, "*** Warning *** - You tried to quit a user (%s) twice. Did your module call QuitUser twice?", user->nick);
                return;
        }
 
@@ -88,7 +88,7 @@ int CullList::Apply()
                                }
                                catch (CoreException& modexcept)
                                {
-                                       ServerInstance->Log(DEBUG, "%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
+                                       ServerInstance->Logs->Log("CULLLIST",DEBUG, "%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
                                }
                        }
 
index 0d822a17da46988007f0159e8192a6999835bad4..447b90781ba0d8436053ae2422fcc82fd4b39618 100644 (file)
@@ -213,7 +213,7 @@ inline void DNS::EmptyHeader(unsigned char *output, const DNSHeader *header, con
 /** Send requests we have previously built down the UDP socket */
 int DNSRequest::SendRequests(const DNSHeader *header, const int length, QueryType qt)
 {
-       ServerInstance->Log(DEBUG,"DNSRequest::SendRequests");
+       ServerInstance->Logs->Log("RESOLVER", DEBUG,"DNSRequest::SendRequests");
 
        unsigned char payload[sizeof(DNSHeader)];
 
@@ -245,7 +245,7 @@ int DNSRequest::SendRequests(const DNSHeader *header, const int length, QueryTyp
                        return -1;
        }
 
-       ServerInstance->Log(DEBUG,"Sent OK");
+       ServerInstance->Logs->Log("RESOLVER",DEBUG,"Sent OK");
        return 0;
 }
 
@@ -332,9 +332,9 @@ void DNS::Rehash()
 
        if ((strstr(ServerInstance->Config->DNSServer,"::ffff:") == (char*)&ServerInstance->Config->DNSServer) ||  (strstr(ServerInstance->Config->DNSServer,"::FFFF:") == (char*)&ServerInstance->Config->DNSServer))
        {
-               ServerInstance->Log(DEFAULT,"WARNING: Using IPv4 addresses over IPv6 forces some DNS checks to be disabled.");
-               ServerInstance->Log(DEFAULT,"         This should not cause a problem, however it is recommended you migrate");
-               ServerInstance->Log(DEFAULT,"         to a true IPv6 environment.");
+               ServerInstance->Logs->Log("RESOLVER",DEFAULT,"WARNING: Using IPv4 addresses over IPv6 forces some DNS checks to be disabled.");
+               ServerInstance->Logs->Log("RESOLVER",DEFAULT,"         This should not cause a problem, however it is recommended you migrate");
+               ServerInstance->Logs->Log("RESOLVER",DEFAULT,"         to a true IPv6 environment.");
                this->ip6munge = true;
        }
 
@@ -366,7 +366,7 @@ void DNS::Rehash()
                if (!ServerInstance->BindSocket(this->GetFd(), portpass, "", false))
                {
                        /* Failed to bind */
-                       ServerInstance->Log(DEBUG,"Error binding dns socket");
+                       ServerInstance->Logs->Log("RESOLVER",DEBUG,"Error binding dns socket");
                        ServerInstance->SE->Shutdown(this, 2);
                        ServerInstance->SE->Close(this);
                        this->SetFd(-1);
@@ -379,7 +379,7 @@ void DNS::Rehash()
                        {
                                if (!ServerInstance->SE->AddFd(this))
                                {
-                                       ServerInstance->Log(DEFAULT,"Internal error starting DNS - hostnames will NOT resolve.");
+                                       ServerInstance->Logs->Log("RESOLVER",DEFAULT,"Internal error starting DNS - hostnames will NOT resolve.");
                                        ServerInstance->SE->Shutdown(this, 2);
                                        ServerInstance->SE->Close(this);
                                        this->SetFd(-1);
@@ -389,14 +389,14 @@ void DNS::Rehash()
        }
        else
        {
-               ServerInstance->Log(DEBUG,"Error creating dns socket");
+               ServerInstance->Logs->Log("RESOLVER",DEBUG,"Error creating dns socket");
        }
 }
 
 /** Initialise the DNS UDP socket so that we can send requests */
 DNS::DNS(InspIRCd* Instance) : ServerInstance(Instance)
 {
-       ServerInstance->Log(DEBUG,"DNS::DNS");
+       ServerInstance->Logs->Log("RESOLVER",DEBUG,"DNS::DNS");
        /* Clear the Resolver class table */
        memset(Classes,0,sizeof(Classes));
 
@@ -959,7 +959,7 @@ void Resolver::TriggerCachedResult()
 /** High level abstraction of dns used by application at large */
 Resolver::Resolver(InspIRCd* Instance, const std::string &source, QueryType qt, bool &cached, Module* creator) : ServerInstance(Instance), Creator(creator), input(source), querytype(qt)
 {
-       ServerInstance->Log(DEBUG,"Resolver::Resolver");
+       ServerInstance->Logs->Log("RESOLVER",DEBUG,"Resolver::Resolver");
        cached = false;
 
        CQ = ServerInstance->Res->GetCache(source);
@@ -1030,7 +1030,7 @@ Resolver::Resolver(InspIRCd* Instance, const std::string &source, QueryType qt,
        }
        else
        {
-               ServerInstance->Log(DEBUG,"DNS request id %d", this->myid);
+               ServerInstance->Logs->Log("RESOLVER",DEBUG,"DNS request id %d", this->myid);
        }
 }
 
@@ -1064,11 +1064,11 @@ void DNS::HandleEvent(EventType, int)
        int resultnum = 0;
        DNSResult res(0,"",0,"");
        res.id = 0;
-       ServerInstance->Log(DEBUG,"Handle DNS event");
+       ServerInstance->Logs->Log("RESOLVER",DEBUG,"Handle DNS event");
 
        res = this->GetResult(resultnum);
 
-       ServerInstance->Log(DEBUG,"Result %d id %d", resultnum, res.id);
+       ServerInstance->Logs->Log("RESOLVER",DEBUG,"Result %d id %d", resultnum, res.id);
        
        /* Is there a usable request id? */
        if (res.id != -1)
@@ -1116,7 +1116,7 @@ void DNS::HandleEvent(EventType, int)
 /** Add a derived Resolver to the working set */
 bool DNS::AddResolverClass(Resolver* r)
 {
-       ServerInstance->Log(DEBUG,"AddResolverClass %08lx", r);
+       ServerInstance->Logs->Log("RESOLVER",DEBUG,"AddResolverClass %08lx", r);
        /* Check the pointers validity and the id's validity */
        if ((r) && (r->GetId() > -1))
        {
index 487af4511fde55efa2e9261b0044d4cd89921b09..465f55d6f9e0ede43da0438b8d9a0e7d99f4f3b8 100644 (file)
@@ -342,7 +342,7 @@ void InspIRCd::CheckRoot()
        if (geteuid() == 0)
        {
                printf("WARNING!!! You are running an irc server as ROOT!!! DO NOT DO THIS!!!\n\n");
-               this->Log(DEFAULT,"Cant start as root");
+               this->Logs->Log("STARTUP",DEFAULT,"Cant start as root");
                Exit(EXIT_STATUS_ROOT);
        }
 }
@@ -352,7 +352,7 @@ void InspIRCd::CheckDie()
        if (*Config->DieValue)
        {
                printf("WARNING: %s\n\n",Config->DieValue);
-               this->Log(DEFAULT,"Died because of <die> tag: %s",Config->DieValue);
+               this->Logs->Log("CONFIG",DEFAULT,"Died because of <die> tag: %s",Config->DieValue);
                Exit(EXIT_STATUS_DIETAG);
        }
 }
index d1af4188caf7163a4d93faac34e88562a7e9e19c..8999e7ccc8c2117e179299373fd666b5d02e0db7 100644 (file)
@@ -232,14 +232,14 @@ bool InspIRCd::DaemonSeed()
        rlimit rl;
        if (getrlimit(RLIMIT_CORE, &rl) == -1)
        {
-               this->Log(DEFAULT,"Failed to getrlimit()!");
+               this->Logs->Log("STARTUP",DEFAULT,"Failed to getrlimit()!");
                return false;
        }
        else
        {
                rl.rlim_cur = rl.rlim_max;
                if (setrlimit(RLIMIT_CORE, &rl) == -1)
-                       this->Log(DEFAULT,"setrlimit() failed, cannot increase coredump size.");
+                       this->Logs->Log("STARTUP",DEFAULT,"setrlimit() failed, cannot increase coredump size.");
        }
 
        return true;
@@ -268,7 +268,7 @@ void InspIRCd::WritePID(const std::string &filename)
        else
        {
                printf("Failed to write PID-file '%s', exiting.\n",fname.c_str());
-               this->Log(DEFAULT,"Failed to write PID-file '%s', exiting.",fname.c_str());
+               this->Logs->Log("STARTUP",DEFAULT,"Failed to write PID-file '%s', exiting.",fname.c_str());
                Exit(EXIT_STATUS_PID);
        }
 }
@@ -426,7 +426,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
        if (!ServerConfig::FileExists(this->ConfigFileName))
        {
                printf("ERROR: Cannot open config file: %s\nExiting...\n", this->ConfigFileName);
-               this->Log(DEFAULT,"Unable to open config file %s", this->ConfigFileName);
+               this->Logs->Log("STARTUP",DEFAULT,"Unable to open config file %s", this->ConfigFileName);
                Exit(EXIT_STATUS_CONFIG);
        }
 
@@ -704,7 +704,7 @@ void InspIRCd::BufferedSocketCull()
 {
        for (std::map<BufferedSocket*,BufferedSocket*>::iterator x = SocketCull.begin(); x != SocketCull.end(); ++x)
        {
-               Log(DEBUG,"Cull socket");
+               this->Logs->Log("MISC",DEBUG,"Cull socket");
                SE->DelFd(x->second);
                x->second->Close();
                delete x->second;
index 17aaa220dc18c9ed75938e27088649d99099e3ad..41f40dc2bef696380d690db94b1817e9b1e58c48 100644 (file)
@@ -116,7 +116,7 @@ BufferedSocket::BufferedSocket(InspIRCd* SI, const std::string &ipaddr, int apor
                }
                if (!ipvalid)
                {
-                       this->Instance->Log(DEBUG,"BUG: Hostname passed to BufferedSocket, rather than an IP address!");
+                       this->Instance->Logs->Log("SOCKET", DEBUG,"BUG: Hostname passed to BufferedSocket, rather than an IP address!");
                        this->OnError(I_ERR_CONNECT);
                        this->Close();
                        this->fd = -1;
@@ -236,7 +236,7 @@ bool BufferedSocket::BindAddr(const std::string &ip)
                }
                j++;
        }
-       Instance->Log(DEBUG,"nothing in the config to bind()!");
+       Instance->Logs->Log("SOCKET", DEBUG,"nothing in the config to bind()!");
        return true;
 }
 
@@ -345,7 +345,7 @@ bool BufferedSocket::DoConnect()
                this->SetQueues(this->fd);
        }
 
-       Instance->Log(DEBUG,"BufferedSocket::DoConnect success");
+       Instance->Logs->Log("SOCKET", DEBUG,"BufferedSocket::DoConnect success");
        return true;
 }
 
@@ -367,7 +367,7 @@ void BufferedSocket::Close()
                        }
                        catch (CoreException& modexcept)
                        {
-                               Instance->Log(DEFAULT,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
+                               Instance->Logs->Log("SOCKET", DEFAULT,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
                        }
                }
                Instance->SE->Shutdown(this, 2);
@@ -402,7 +402,7 @@ const char* BufferedSocket::Read()
                }
                catch (CoreException& modexcept)
                {
-                       Instance->Log(DEFAULT,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
+                       Instance->Logs->Log("SOCKET", DEFAULT,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
                }
                if (MOD_RESULT < 0)
                {
@@ -470,7 +470,7 @@ bool BufferedSocket::FlushWriteBuffer()
                                }
                                catch (CoreException& modexcept)
                                {
-                                       Instance->Log(DEBUG,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
+                                       Instance->Logs->Log("SOCKET", DEBUG,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
                                        return true;
                                }
                        }
@@ -536,7 +536,7 @@ bool BufferedSocket::FlushWriteBuffer()
 
 void SocketTimeout::Tick(time_t)
 {
-       ServerInstance->Log(DEBUG,"SocketTimeout::Tick");
+       ServerInstance->Logs->Log("SOCKET", DEBUG,"SocketTimeout::Tick");
 
        if (ServerInstance->SE->GetRef(this->sfd) != this->sock)
                return;
@@ -594,14 +594,14 @@ bool BufferedSocket::Poll()
 
                        if (Instance->Config->GetIOHook(this))
                        {
-                               Instance->Log(DEBUG,"Hook for raw connect");
+                               Instance->Logs->Log("SOCKET",DEBUG,"Hook for raw connect");
                                try
                                {
                                        Instance->Config->GetIOHook(this)->OnRawSocketConnect(this->fd);
                                }
                                catch (CoreException& modexcept)
                                {
-                                       Instance->Log(DEBUG,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
+                                       Instance->Logs->Log("SOCKET",DEBUG,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
                                }
                        }
                        return this->OnConnected();
@@ -643,7 +643,7 @@ bool BufferedSocket::Poll()
                                }
                                catch (CoreException& modexcept)
                                {
-                                       Instance->Log(DEBUG,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
+                                       Instance->Logs->Log("SOCKET",DEBUG,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
                                }
                        }
 
index 5a0cdbf1ee0a460c5766d1e5ef0005e55fc4a1e1..b3f05bd3710639237bbcb7ac209c271baa2bbfe0 100644 (file)
@@ -91,7 +91,7 @@ unsigned int ModeHandler::GetCount()
 void ModeHandler::ChangeCount(int modifier)
 {
        count += modifier;
-       ServerInstance->Log(DEBUG,"Change count for mode %c is now %d", mode, count);
+       ServerInstance->Logs->Log("MODE", DEBUG,"Change count for mode %c is now %d", mode, count);
 }
 
 ModeType ModeHandler::GetModeType()
@@ -521,13 +521,13 @@ void ModeParser::Process(const char* const* parameters, int pcnt, User *user, bo
 
                                                        if (!SkipAccessChecks && IS_LOCAL(user) && (MOD_RESULT != ACR_ALLOW))
                                                        {
-                                                               ServerInstance->Log(DEBUG,"Enter minimum prefix check");
+                                                               ServerInstance->Logs->Log("MODE", DEBUG,"Enter minimum prefix check");
                                                                /* Check access to this mode character */
                                                                if ((type == MODETYPE_CHANNEL) && (modehandlers[handler_id]->GetNeededPrefix()))
                                                                {
                                                                        char needed = modehandlers[handler_id]->GetNeededPrefix();
                                                                        ModeHandler* prefixmode = FindPrefix(needed);
-                                                                       ServerInstance->Log(DEBUG,"Needed prefix: %c", needed);
+                                                                       ServerInstance->Logs->Log("MODE", DEBUG,"Needed prefix: %c", needed);
 
                                                                        /* If the mode defined by the handler is not '\0', but the handler for it
                                                                         * cannot be found, they probably dont have the right module loaded to implement
index bedd4b6b6fdc5f99a171f9a6dbc635db6a8d786f..57aa3e95054c9f758c4cedd55d2ad7a5432905d7 100644 (file)
@@ -91,7 +91,7 @@ std::string& ModeChannelBan::AddBan(User *user, std::string &dest, Channel *chan
 {
        if ((!user) || (!chan))
        {
-               ServerInstance->Log(DEFAULT,"*** BUG *** AddBan was given an invalid parameter");
+               ServerInstance->Logs->Log("MODE",DEFAULT,"*** BUG *** AddBan was given an invalid parameter");
                dest = "";
                return dest;
        }
@@ -151,7 +151,7 @@ std::string& ModeChannelBan::DelBan(User *user, std::string& dest, Channel *chan
 {
        if ((!user) || (!chan))
        {
-               ServerInstance->Log(DEFAULT,"*** BUG *** TakeBan was given an invalid parameter");
+               ServerInstance->Logs->Log("MODE",DEFAULT,"*** BUG *** TakeBan was given an invalid parameter");
                dest = "";
                return dest;
        }
index ba98ad8651285d47421dd96df36563aaebe2ea0f..3e7ae9cdfd100c4b3b4714090930410d67fa2676 100644 (file)
@@ -381,21 +381,21 @@ bool ModuleManager::Load(const char* filename)
        if (!ServerConfig::DirValid(modfile))
        {
                LastModuleError = "Module " + filename_str + " is not within the modules directory.";
-               Instance->Log(DEFAULT, LastModuleError);
+               Instance->Logs->Log("MODULE", DEFAULT, LastModuleError);
                return false;
        }
        
        if (!ServerConfig::FileExists(modfile))
        {
                LastModuleError = "Module file could not be found: " + filename_str;
-               Instance->Log(DEFAULT, LastModuleError);
+               Instance->Logs->Log("MODULE", DEFAULT, LastModuleError);
                return false;
        }
        
        if (Modules.find(filename_str) != Modules.end())
        {       
                LastModuleError = "Module " + filename_str + " is already loaded, cannot load a module twice!";
-               Instance->Log(DEFAULT, LastModuleError);
+               Instance->Logs->Log("MODULE", DEFAULT, LastModuleError);
                return false;
        }
                
@@ -420,12 +420,12 @@ bool ModuleManager::Load(const char* filename)
                                delete newmod;
                                delete newhandle;
                                LastModuleError = "Unable to load " + filename_str + ": Incorrect module API version: " + ConvToStr(v.API) + " (our version: " + ConvToStr(API_VERSION) + ")";
-                               Instance->Log(DEFAULT, LastModuleError);
+                               Instance->Logs->Log("MODULE", DEFAULT, LastModuleError);
                                return false;
                        }
                        else
                        {
-                               Instance->Log(DEFAULT,"New module introduced: %s (API version %d, Module version %d.%d.%d.%d)%s", filename, v.API, v.Major, v.Minor, v.Revision, v.Build, (!(v.Flags & VF_VENDOR) ? " [3rd Party]" : " [Vendor]"));
+                               Instance->Logs->Log("MODULE", DEFAULT,"New module introduced: %s (API version %d, Module version %d.%d.%d.%d)%s", filename, v.API, v.Major, v.Minor, v.Revision, v.Build, (!(v.Flags & VF_VENDOR) ? " [3rd Party]" : " [Vendor]"));
                        }
 
                        Modules[filename_str] = std::make_pair(newhandle, newmod);
@@ -434,7 +434,7 @@ bool ModuleManager::Load(const char* filename)
                {
                        delete newhandle;
                        LastModuleError = "Unable to load " + filename_str + ": Probably missing init_module() entrypoint, but dlsym() didn't notice a problem";
-                       Instance->Log(DEFAULT, LastModuleError);
+                       Instance->Logs->Log("MODULE", DEFAULT, LastModuleError);
                        return false;
                }
        }
@@ -447,7 +447,7 @@ bool ModuleManager::Load(const char* filename)
                if (newhandle)
                        delete newhandle;
                LastModuleError = "Unable to load " + filename_str + ": Error when loading: " + modexcept.GetReason();
-               Instance->Log(DEFAULT, LastModuleError);
+               Instance->Logs->Log("MODULE", DEFAULT, LastModuleError);
                return false;
        }
        catch (FindSymbolException& modexcept)
@@ -458,7 +458,7 @@ bool ModuleManager::Load(const char* filename)
                if (newhandle)
                        delete newhandle;
                LastModuleError = "Unable to load " + filename_str + ": Error finding symbol: " + modexcept.GetReason();
-               Instance->Log(DEFAULT, LastModuleError);
+               Instance->Logs->Log("MODULE", DEFAULT, LastModuleError);
                return false;
        }
        catch (CoreException& modexcept)
@@ -469,7 +469,7 @@ bool ModuleManager::Load(const char* filename)
                if (newhandle)
                        delete newhandle;
                LastModuleError = "Unable to load " + filename_str + ": " + modexcept.GetReason();
-               Instance->Log(DEFAULT, LastModuleError);
+               Instance->Logs->Log("MODULE", DEFAULT, LastModuleError);
                return false;
        }
 
@@ -497,14 +497,14 @@ bool ModuleManager::Unload(const char* filename)
                if (modfind->second.second->GetVersion().Flags & VF_STATIC)
                {
                        LastModuleError = "Module " + filename_str + " not unloadable (marked static)";
-                       Instance->Log(DEFAULT, LastModuleError);
+                       Instance->Logs->Log("MODULE", DEFAULT, LastModuleError);
                        return false;
                }
                std::pair<int,std::string> intercount = GetInterfaceInstanceCount(modfind->second.second);
                if (intercount.first > 0)
                {
                        LastModuleError = "Failed to unload module " + filename_str + ", being used by " + ConvToStr(intercount.first) + " other(s) via interface '" + intercount.second + "'";
-                       Instance->Log(DEFAULT, LastModuleError);
+                       Instance->Logs->Log("MODULE", DEFAULT, LastModuleError);
                        return false;
                }
 
@@ -532,14 +532,14 @@ bool ModuleManager::Unload(const char* filename)
                delete modfind->second.first;
                Modules.erase(modfind);
 
-               Instance->Log(DEFAULT,"Module %s unloaded",filename);
+               Instance->Logs->Log("MODULE", DEFAULT,"Module %s unloaded",filename);
                this->ModCount--;
                Instance->BuildISupport();
                return true;
        }
 
        LastModuleError = "Module " + filename_str + " is not loaded, cannot unload it!";
-       Instance->Log(DEFAULT, LastModuleError);
+       Instance->Logs->Log("MODULE", DEFAULT, LastModuleError);
        return false;
 }
 
@@ -556,7 +556,7 @@ void ModuleManager::LoadAll()
                
                if (!this->Load(configToken))           
                {
-                       Instance->Log(DEFAULT, this->LastError());
+                       Instance->Logs->Log("MODULE", DEFAULT, this->LastError());
                        printf_c("\n[\033[1;31m*\033[0m] %s\n\n", this->LastError().c_str());
                        Instance->Exit(EXIT_STATUS_MODULE);
                }
index b5c0c17622cdc0e0a77df2eb70f389bd07880821..f751a846dff0b97e34986d6455fea7a0c7a483dd 100644 (file)
@@ -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);
index 03dd9934281452148101773c6e2db1d43d2f06d0..d79eb11ff9e9c4120257ac033d862c5261b1caa4 100644 (file)
@@ -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;
index a77e1ac90c1372fba6ad11c8c9ef8242ee9922a0..72351cc9326d03dab64226b55805b64beebf7063 100644 (file)
@@ -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;
                }
 
index 189479efc138eebf373ae6bbd4f3bbc85167c82d..409e01ccd3db5df96409f545c726c4315f08cdbd 100644 (file)
@@ -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)
                {
index 1e62eb9710ba6a3397876f1b067382592b3b9714..9a5c900f2a39d5de20bdacd458d30e1bd33b2e3b 100644 (file)
@@ -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;
                }
 
index a1e28bafe1923353c53b5c7509d7634cc3264cfc..01ff0b3d4f4d9b5270251e1f384351374d9b3699 100644 (file)
@@ -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?!");
                }
        }
 
index 30fcf968e8d22b58611ae04c39308bedbde61733..5935e15536095578ca740dd3fbf8e10d5cfdbc6e 100644 (file)
@@ -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);
                                }
                        }
                        
index e1f4b8451982848b2ad8c87e6d8ea4a3bcda26e0..f79ef47fa03198a45bf21193b080f160bc4c621e 100644 (file)
@@ -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()
index 667b2a5cd3ab0665cd7cc0491527d24eacab8054..2af851f05ab7fdb4309e31c675ee8fad9368b1db 100644 (file)
@@ -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;
 }
 
index 312ec874b13bf2f0c2d5fdfb13b4159613c40424..abf8c5d4a4e91f9ecae9e021f083ab6f759ccb75 100644 (file)
@@ -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;
                                                }
                                        }
index cfad61f173d4c2a40b6d1d2603337cb033481ea1..bcbc82cac5a814f74306d86fe52bcd5a62e59177 100644 (file)
@@ -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;
                }
        }
index 633e95af9601597ff18c443926f21533d6cafffe..3f7e27418a34bdbd025d8094d55f7107a4095baf 100644 (file)
@@ -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;
                        }
                }
index 1be1f85fff65c8108a497896d3f051cc4a4522e6..e1f97bd72855fc15718f296a7496bca0cf490ed0 100644 (file)
@@ -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;
index 612b9d62b43d514b29eef6d5fadf6682f8fcbbf9..bffdd7730b190178db6ea8c14004a8829e160455 100644 (file)
@@ -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);
        }
 
 };
index 4cb7b28480a230be515bcbf41c6c8c1691f28058..9cf6e45b4fcc2c72062e79b316d3b07e6cbbe1e5 100644 (file)
@@ -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;
index 56a24119f254b7ebfb3e9a4d35815af88b80d923..3bf99bfdf12d50ff46de46b58afe9856fe0af6c8 100644 (file)
@@ -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;
                        }
index 185b9cf6d747c98d2149ee691cfc8b88eab4fa4a..fd9fd4434ac96e632f3ddabf1f2f861a788ace8b 100644 (file)
@@ -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);
                }
        }
 };
index eac5a94073c1133be871ce2b8ea3750420488e77..a9ce4aa9be4a5854642768e435800477499af100 100644 (file)
@@ -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());
                        }
                }
 
index 0db1147dd774c573de35fb772dea4a1ddbace1d7..bd039865aaf58b5cbb2da152b21f0aecf65bb11d 100644 (file)
@@ -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);
index f65382ac109f627e1abb1b829cb69bf4ee51878a..6b2c489f8433f652f4e109a847b69ce33cb74d0b 100644 (file)
@@ -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);
                }
        }
 };
index 2509a17b713b0d303a5c793e4cf170441dd39151..6da23b7357c178c9e16c4393ef1f56beae8f09f5 100644 (file)
@@ -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();
        }
 };
index d55b4a251aa7ff9d0692fcdb2218ba19f4f21e7d..a0dc6cb0ec9f89992b320fe8c9953025f369a969 100644 (file)
@@ -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
index 889ecb0a6d477659aa989653eb857bf450bf3d78..ab2839900b57a973669fd41d9335db0390fc8955 100644 (file)
@@ -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;
                        }
                }
index 1a176da85a83d8517e9d09239d4324dccb6b3810..f7807824f980f9e04d58da3d92840f3192b8a7dd 100644 (file)
@@ -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
index 0b6c4430a8e6bb7aad5ff88de7a1aef3cd7dcf32..a4fe5836ad4ed5bf490d0b87565a5581100f3f77 100644 (file)
@@ -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;
                        }
                }
index a6fbab1649bd4db70329c212e0163a172ec32a3c..260b4523cb32c3eff86ac05825ee9d9ffaf08b11 100644 (file)
@@ -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)
                {
index 6632ea9077ad1f48cd984e4b78b155eaac0063d1..e01760dace3a611d75962d1eb37b4250c80ac6e7 100644 (file)
@@ -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;
 }
index 062aed85516c2382a54871c989a27b28396f9a36..c2e365c35129ece0b707aae08198d40452908d0f 100644 (file)
@@ -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);
index de7142bea0a391ddd3bef38b575de445767d21ef..d303ef322e5ae8ddeea35d30fd4cfd12794fbbe2 100644 (file)
@@ -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))
index 6ca6a5746d7d900362b23b4c4ac649fde99a1393..54fd9c4815ea54ce294ab2b04576a38d6d246107 100644 (file)
@@ -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());
        }
 };
 
index cbbc7190a8345915cdc3b517544a0f5843e260fe..d98d730507c09b363d82580117699b0d991f1c9d 100644 (file)
@@ -212,7 +212,7 @@ bool TreeSocket::Inbound_Server(std::deque<std::string> &params)
                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)
                        {
index 5c85e5e5d29242982b7c8e864921290645e1c9b3..db26b3f889ee6a0a414eba0cd5ebd9a27e17d808 100644 (file)
@@ -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())
index 34b8e112d83f8f859fd4d5ec6b54ff1ff24fc76c..eed4383d028d8595dbee5bee9346b1205409a994 100644 (file)
@@ -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
index 76920d6e60bd9f4946cce7aaa5899344b72240e6..023fa0ac83bf7e639cefc90bf125c60bc3fd7038 100644 (file)
@@ -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;
                                                        }
index 0768ec16f8d34eff09ba01d76776c1f06338704c..62059f99c6631caac0aacaa9e45f2a63e01ec6d4 100644 (file)
@@ -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)
index fb4a81ba16a3ddf124a8eb4f5f17adaec3c93a88..7480923b6ff53df65ef97370b52348eb71a31dd0 100644 (file)
@@ -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
                        {
index 4701a717b336b055e4865cba7e55fb0692029566..a101254292b31583dc69ef84966955fab3123538 100644 (file)
@@ -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;
index 5b4553ab7975e728d50b7b5ca63445156d3a00fa..de65827986b8eb9a899f35e7b2591492f170153c 100644 (file)
@@ -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;
                                }
index b18904ed84d021fda8c69acdb33b2f79b98ac6be..cacd1f3484b72f65cefad7a8829cd21b31b2e832 100644 (file)
@@ -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());
                                        }
                                }
                        }
index 81f2a6f27d8a3509cc8b4ab958ddd3871fe22271..e045df1f99610a38db7b6df0f3af34d94a25033b 100644 (file)
@@ -58,9 +58,9 @@ ListenSocket::~ListenSocket()
        if (this->GetFd() > -1)
        {
                ServerInstance->SE->DelFd(this);
-               ServerInstance->Log(DEBUG,"Shut down listener on fd %d", this->fd);
+               ServerInstance->Logs->Log("SOCKET", DEBUG,"Shut down listener on fd %d", this->fd);
                if (ServerInstance->SE->Shutdown(this, 2) || ServerInstance->SE->Close(this))
-                       ServerInstance->Log(DEBUG,"Failed to cancel listener: %s", strerror(errno));
+                       ServerInstance->Logs->Log("SOCKET", DEBUG,"Failed to cancel listener: %s", strerror(errno));
                this->fd = -1;
        }
 }
@@ -124,7 +124,7 @@ void ListenSocket::HandleEvent(EventType, int)
                        }
                        catch (CoreException& modexcept)
                        {
-                               ServerInstance->Log(DEBUG,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
+                               ServerInstance->Logs->Log("SOCKET", DEBUG,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
                        }
                }
                ServerInstance->stats->statsAccept++;
@@ -412,19 +412,19 @@ bool InspIRCd::BindSocket(int sockfd, int port, const char* addr, bool dolisten)
                {
                        if (SE->Listen(sockfd, Config->MaxConn) == -1)
                        {
-                               this->Log(DEFAULT,"ERROR in listen(): %s",strerror(errno));
+                               this->Logs->Log("SOCKET",DEFAULT,"ERROR in listen(): %s",strerror(errno));
                                return false;
                        }
                        else
                        {
-                               this->Log(DEBUG,"New socket binding for %d with listen: %s:%d", sockfd, addr, port);
+                               this->Logs->Log("SOCKET",DEBUG,"New socket binding for %d with listen: %s:%d", sockfd, addr, port);
                                SE->NonBlocking(sockfd);
                                return true;
                        }
                }
                else
                {
-                       this->Log(DEBUG,"New socket binding for %d without listen: %s:%d", sockfd, addr, port);
+                       this->Logs->Log("SOCKET",DEBUG,"New socket binding for %d without listen: %s:%d", sockfd, addr, port);
                        return true;
                }
        }
@@ -478,7 +478,7 @@ int InspIRCd::BindPorts(bool, int &ports_found, FailedPortList &failed_ports)
                Config->ConfValue(Config->config_data, "bind", "type", count, Type, MAXBUF);
                
                if (strncmp(Addr, "::ffff:", 7) == 0)
-                       this->Log(DEFAULT, "Using 4in6 (::ffff:) isn't recommended. You should bind IPv4 addresses directly instead.");
+                       this->Logs->Log("SOCKET",DEFAULT, "Using 4in6 (::ffff:) isn't recommended. You should bind IPv4 addresses directly instead.");
                
                if ((!*Type) || (!strcmp(Type,"clients")))
                {
@@ -533,7 +533,7 @@ int InspIRCd::BindPorts(bool, int &ports_found, FailedPortList &failed_ports)
                        {
                                if (((*n)->GetIP() == old_ports[k].first) && ((*n)->GetPort() == old_ports[k].second))
                                {
-                                       this->Log(DEFAULT,"Port binding %s:%d was removed from the config file, closing.", old_ports[k].first.c_str(), old_ports[k].second);
+                                       this->Logs->Log("SOCKET",DEFAULT,"Port binding %s:%d was removed from the config file, closing.", old_ports[k].first.c_str(), old_ports[k].second);
                                        delete *n;
                                        Config->ports.erase(n);
                                        break;
index ccfa0f769090ebe4c827307a50405e147d594dc2..1a0c5d53ecf75e3a00ebb56c2d1acf366aa36ba9 100644 (file)
@@ -22,8 +22,8 @@ EPollEngine::EPollEngine(InspIRCd* Instance) : SocketEngine(Instance)
 
        if (EngineHandle == -1)
        {
-               ServerInstance->Log(DEFAULT, "ERROR: Could not initialize socket engine: %s", strerror(errno));
-               ServerInstance->Log(DEFAULT, "ERROR: Your kernel probably does not have the proper features. This is a fatal error, exiting now.");
+               ServerInstance->Logs->Log("SOCKET",DEFAULT, "ERROR: Could not initialize socket engine: %s", strerror(errno));
+               ServerInstance->Logs->Log("SOCKET",DEFAULT, "ERROR: Your kernel probably does not have the proper features. This is a fatal error, exiting now.");
                printf("ERROR: Could not initialize socket engine: %s\n", strerror(errno));
                printf("ERROR: Your kernel probably does not have the proper features. This is a fatal error, exiting now.\n");
                ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE);
@@ -41,7 +41,7 @@ bool EPollEngine::AddFd(EventHandler* eh)
        int fd = eh->GetFd();
        if ((fd < 0) || (fd > MAX_DESCRIPTORS))
        {
-               ServerInstance->Log(DEBUG,"Out of range FD");
+               ServerInstance->Logs->Log("SOCKET",DEBUG,"Out of range FD");
                return false;
        }
 
@@ -61,7 +61,7 @@ bool EPollEngine::AddFd(EventHandler* eh)
                return false;
        }
 
-       ServerInstance->Log(DEBUG,"New file descriptor: %d", fd);
+       ServerInstance->Logs->Log("SOCKET",DEBUG,"New file descriptor: %d", fd);
 
        ref[fd] = eh;
        CurrentSetSize++;
@@ -94,14 +94,14 @@ bool EPollEngine::DelFd(EventHandler* eh, bool force)
 
        if (i < 0 && !force)
        {
-               ServerInstance->Log(DEBUG,"Cant remove socket: %s", strerror(errno));
+               ServerInstance->Logs->Log("SOCKET",DEBUG,"Cant remove socket: %s", strerror(errno));
                return false;
        }
 
        ref[fd] = NULL;
        CurrentSetSize--;
 
-       ServerInstance->Log(DEBUG,"Remove file descriptor: %d", fd);
+       ServerInstance->Logs->Log("SOCKET",DEBUG,"Remove file descriptor: %d", fd);
        return true;
 }
 
index 9b7dd63c751e3be43189c20df85548da1675f20c..5bc1faed4d246e64a90565353d4aa6cef68be3cf 100644 (file)
@@ -22,8 +22,8 @@ IOCPEngine::IOCPEngine(InspIRCd * Instance) : SocketEngine(Instance)
 
        if (!m_completionPort)
        {
-               ServerInstance->Log(DEFAULT, "ERROR: Could not initialize socket engine. Your kernel probably does not have the proper features.");
-               ServerInstance->Log(DEFAULT, "ERROR: this is a fatal error, exiting now.");
+               ServerInstance->Logs->Log("SOCKET",DEFAULT, "ERROR: Could not initialize socket engine. Your kernel probably does not have the proper features.");
+               ServerInstance->Logs->Log("SOCKET",DEFAULT, "ERROR: this is a fatal error, exiting now.");
                printf("ERROR: Could not initialize socket engine. Your kernel probably does not have the proper features.\n");
                printf("ERROR: this is a fatal error, exiting now.\n");
                ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE);
@@ -84,7 +84,7 @@ bool IOCPEngine::AddFd(EventHandler* eh)
                PostReadEvent(eh);
 
        /* log message */
-       ServerInstance->Log(DEBUG, "New fake fd: %u, real fd: %u, address 0x%p", *fake_fd, eh->GetFd(), eh);
+       ServerInstance->Logs->Log("SOCKET",DEBUG, "New fake fd: %u, real fd: %u, address 0x%p", *fake_fd, eh->GetFd(), eh);
 
        /* post a write event if there is data to be written */
        if(eh->Writeable())
@@ -123,7 +123,7 @@ bool IOCPEngine::DelFd(EventHandler* eh, bool force /* = false */)
        void* m_writeEvent = NULL;
        void* m_acceptEvent = NULL;
 
-       ServerInstance->Log(DEBUG, "Removing fake fd %u, real fd %u, address 0x%p", *fake_fd, eh->GetFd(), eh);
+       ServerInstance->Logs->Log("SOCKET",DEBUG, "Removing fake fd %u, real fd %u, address 0x%p", *fake_fd, eh->GetFd(), eh);
 
        /* Cancel pending i/o operations. */
        if (CancelIo((HANDLE)fd) == FALSE)
index a2bbd5afe442e18445056abec795019f648a454a..f245830de93818f3c6f7aa0fba010eb3e85db1ea 100644 (file)
@@ -34,8 +34,8 @@ void KQueueEngine::RecoverFromFork()
        EngineHandle = kqueue();
        if (EngineHandle == -1)
        {
-               ServerInstance->Log(DEFAULT, "ERROR: Could not initialize socket engine. Your kernel probably does not have the proper features.");
-               ServerInstance->Log(DEFAULT, "ERROR: this is a fatal error, exiting now.");
+               ServerInstance->Logs->Log("SOCKET",DEFAULT, "ERROR: Could not initialize socket engine. Your kernel probably does not have the proper features.");
+               ServerInstance->Logs->Log("SOCKET",DEFAULT, "ERROR: this is a fatal error, exiting now.");
                printf("ERROR: Could not initialize socket engine. Your kernel probably does not have the proper features.\n");
                printf("ERROR: this is a fatal error, exiting now.\n");
                ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE);
@@ -73,7 +73,7 @@ bool KQueueEngine::AddFd(EventHandler* eh)
        ref[fd] = eh;
        CurrentSetSize++;
 
-       ServerInstance->Log(DEBUG,"New file descriptor: %d", fd);
+       ServerInstance->Logs->Log("SOCKET",DEBUG,"New file descriptor: %d", fd);
        return true;
 }
 
@@ -99,7 +99,7 @@ bool KQueueEngine::DelFd(EventHandler* eh, bool force)
        CurrentSetSize--;
        ref[fd] = NULL;
 
-       ServerInstance->Log(DEBUG,"Remove file descriptor: %d", fd);
+       ServerInstance->Logs->Log("SOCKET",DEBUG,"Remove file descriptor: %d", fd);
        return true;
 }
 
index 0d97b91df0bd0b9d31a4f5d223d7737ca4ffa063..767ea0df0a8958f5235f7bfce00eb6ab53b7a4dd 100644 (file)
@@ -22,8 +22,8 @@ PortsEngine::PortsEngine(InspIRCd* Instance) : SocketEngine(Instance)
 
        if (EngineHandle == -1)
        {
-               ServerInstance->Log(SPARSE,"ERROR: Could not initialize socket engine: %s", strerror(errno));
-               ServerInstance->Log(SPARSE,"ERROR: This is a fatal error, exiting now.");
+               ServerInstance->Logs->Log("SOCKET",SPARSE,"ERROR: Could not initialize socket engine: %s", strerror(errno));
+               ServerInstance->Logs->Log("SOCKET",SPARSE,"ERROR: This is a fatal error, exiting now.");
                printf("ERROR: Could not initialize socket engine: %s\n", strerror(errno));
                printf("ERROR: This is a fatal error, exiting now.\n");
                ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE);
@@ -51,7 +51,7 @@ bool PortsEngine::AddFd(EventHandler* eh)
        ref[fd] = eh;
        port_associate(EngineHandle, PORT_SOURCE_FD, fd, eh->Readable() ? POLLRDNORM : POLLWRNORM, eh);
 
-       ServerInstance->Log(DEBUG,"New file descriptor: %d", fd);
+       ServerInstance->Logs->Log("SOCKET",DEBUG,"New file descriptor: %d", fd);
        CurrentSetSize++;
        return true;
 }
@@ -72,7 +72,7 @@ bool PortsEngine::DelFd(EventHandler* eh, bool force)
        CurrentSetSize--;
        ref[fd] = NULL;
 
-       ServerInstance->Log(DEBUG,"Remove file descriptor: %d", fd);
+       ServerInstance->Logs->Log("SOCKET",DEBUG,"Remove file descriptor: %d", fd);
        return true;
 }
 
index cc7232b9919550bca550b802b2f5f877c5d1d6f7..8ee381877b5b656cf1282efb4d5b3be8ee8e8f90 100644 (file)
@@ -45,7 +45,7 @@ bool SelectEngine::AddFd(EventHandler* eh)
        ref[fd] = eh;
        CurrentSetSize++;
 
-       ServerInstance->Log(DEBUG,"New file descriptor: %d", fd);
+       ServerInstance->Logs->Log("SOCKET",DEBUG,"New file descriptor: %d", fd);
        return true;
 }
 
@@ -69,7 +69,7 @@ bool SelectEngine::DelFd(EventHandler* eh, bool force)
        ref[fd] = NULL;
        fds[fd] = 0;
 
-       ServerInstance->Log(DEBUG,"Remove file descriptor: %d", fd);
+       ServerInstance->Logs->Log("SOCKET",DEBUG,"Remove file descriptor: %d", fd);
        return true;
 }
 
index ea3b46272ef2df56f3a6af2234d07560ba8a1432..3f010df036828bdd4245920cb5daa31b76f5f6ab 100644 (file)
@@ -54,7 +54,7 @@ void UserResolver::OnLookupComplete(const std::string &result, unsigned int ttl,
                }
                catch (CoreException& e)
                {
-                       ServerInstance->Log(DEBUG,"Error in resolver: %s",e.GetReason());
+                       ServerInstance->Logs->Log("RESOLVER", DEBUG,"Error in resolver: %s",e.GetReason());
                }
        }
        else if ((this->fwd) && (ServerInstance->SE->GetRef(this->bound_fd) == this->bound_user))
index ca9736f1e9e41879effb892cac2f7c85cdb82297..6145c887b5595a731b48f191ef009da2ee042e44 100644 (file)
@@ -30,12 +30,12 @@ void UserManager::AddClient(InspIRCd* Instance, int socket, int port, bool iscac
        }
        catch (...)
        {
-               Instance->Log(DEFAULT,"*** WTF *** Duplicated UUID! -- Crack smoking monkies have been unleashed.");
+               Instance->Logs->Log("USERS", DEFAULT,"*** WTF *** Duplicated UUID! -- Crack smoking monkies have been unleashed.");
                Instance->SNO->WriteToSnoMask('A', "WARNING *** Duplicate UUID allocated!");
                return;
        }
 
-       Instance->Log(DEBUG,"New user fd: %d", socket);
+       Instance->Logs->Log("USERS", DEBUG,"New user fd: %d", socket);
 
        int j = 0;
 
@@ -130,7 +130,7 @@ void UserManager::AddClient(InspIRCd* Instance, int socket, int port, bool iscac
                if (!b->Type.empty() && !New->exempt)
                {
                        /* user banned */
-                       Instance->Log(DEBUG, std::string("BanCache: Positive hit for ") + New->GetIPString());
+                       Instance->Logs->Log("BANCACHE", DEBUG, std::string("BanCache: Positive hit for ") + New->GetIPString());
                        if (*Instance->Config->MoronBanner)
                                New->WriteServ("NOTICE %s :*** %s", New->nick, Instance->Config->MoronBanner);
                        User::QuitUser(Instance, New, b->Reason);
@@ -138,7 +138,7 @@ void UserManager::AddClient(InspIRCd* Instance, int socket, int port, bool iscac
                }
                else
                {
-                       Instance->Log(DEBUG, std::string("BanCache: Negative hit for ") + New->GetIPString());
+                       Instance->Logs->Log("BANCACHE", DEBUG, std::string("BanCache: Negative hit for ") + New->GetIPString());
                }
        }
        else
@@ -157,7 +157,7 @@ void UserManager::AddClient(InspIRCd* Instance, int socket, int port, bool iscac
 
        if (!Instance->SE->AddFd(New))
        {
-               Instance->Log(DEBUG,"Internal error on new connection");
+               Instance->Logs->Log("USERS", DEBUG,"Internal error on new connection");
                User::QuitUser(Instance, New, "Internal error handling connection");
        }
 
@@ -321,7 +321,7 @@ void UserManager::WriteMode(const char* modes, int flags, const char* text, ...)
 
        if (!text || !modes || !flags)
        {
-               ServerInstance->Log(DEFAULT,"*** BUG *** WriteMode was given an invalid parameter");
+               ServerInstance->Logs->Log("USERS", DEFAULT,"*** BUG *** WriteMode was given an invalid parameter");
                return;
        }
 
index 3ba09a7595a93a2628c5a1b1622ecce8a17cba0e..62cd452cd182aee2e67e743897d3a8b7f7b115bc 100644 (file)
@@ -21,7 +21,7 @@
 
 void FloodQuitUserHandler::Call(User* current)
 {
-       Server->Log(DEFAULT,"Excess flood from: %s@%s", current->ident, current->host);
+       Server->Logs->Log("USERS",DEFAULT,"Excess flood from: %s@%s", current->ident, current->host);
        Server->SNO->WriteToSnoMask('f',"Excess flood from: %s%s%s@%s",
                        current->registered == REG_ALL ? current->nick : "",
                        current->registered == REG_ALL ? "!" : "", current->ident, current->host);
@@ -57,7 +57,7 @@ void ProcessUserHandler::Call(User* cu)
                }
                catch (CoreException& modexcept)
                {
-                       Server->Log(DEBUG, "%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
+                       Server->Logs->Log("USERS",DEBUG, "%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
                }
 
                if (MOD_RESULT < 0)
index 8fdf336cc448f9d8b3d40a034887346ae59fb7bb..f1c3a3fef01577472921287d85dfb34cdf1b1e7c 100644 (file)
@@ -692,7 +692,7 @@ void User::Oper(const std::string &opertype, const std::string &opername)
 
        catch (...)
        {
-               ServerInstance->Log(DEBUG,"Exception in User::Oper()");
+               ServerInstance->Logs->Log("OPER", DEBUG,"Exception in User::Oper()");
        }
 }
 
@@ -958,7 +958,7 @@ void User::SetSockAddr(int protocol_family, const char* sip, int port)
                }
                break;
                default:
-                       ServerInstance->Log(DEBUG,"Uh oh, I dont know protocol %d to be set on '%s'!", protocol_family, this->nick);
+                       ServerInstance->Logs->Log("USERS",DEBUG,"Uh oh, I dont know protocol %d to be set on '%s'!", protocol_family, this->nick);
                break;
        }
 }
@@ -1070,7 +1070,7 @@ void User::Write(std::string text)
        }
        catch (...)
        {
-               ServerInstance->Log(DEBUG,"Exception in User::Write() std::string::append");
+               ServerInstance->Logs->Log("USEROUTPUT", DEBUG,"Exception in User::Write() std::string::append");
                return;
        }
 
@@ -1085,7 +1085,7 @@ void User::Write(std::string text)
                }
                catch (CoreException& modexcept)
                {
-                       ServerInstance->Log(DEBUG, "%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
+                       ServerInstance->Logs->Log("USEROUTPUT", DEBUG, "%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
                }
        }
        else
@@ -1590,7 +1590,7 @@ ConnectClass* User::SetClass(const std::string &explicit_name)
                /* deny change if change will take class over the limit */
                if (found->limit && (found->RefCount + 1 >= found->limit))
                {
-                       ServerInstance->Log(DEBUG, "OOPS: Connect class limit (%u) hit, denying", found->limit);
+                       ServerInstance->Logs->Log("USERS", DEBUG, "OOPS: Connect class limit (%u) hit, denying", found->limit);
                        return this->MyClass;
                }
 
@@ -1600,12 +1600,12 @@ ConnectClass* User::SetClass(const std::string &explicit_name)
                        if (found == this->MyClass) // no point changing this shit :P
                                return this->MyClass;
                        this->MyClass->RefCount--;
-                       ServerInstance->Log(DEBUG, "Untying user from connect class -- refcount: %u", this->MyClass->RefCount);
+                       ServerInstance->Logs->Log("USERS", DEBUG, "Untying user from connect class -- refcount: %u", this->MyClass->RefCount);
                }
 
                this->MyClass = found;
                this->MyClass->RefCount++;
-               ServerInstance->Log(DEBUG, "User tied to new class -- connect refcount now: %u", this->MyClass->RefCount);
+               ServerInstance->Logs->Log("USERS", DEBUG, "User tied to new class -- connect refcount now: %u", this->MyClass->RefCount);
        }
 
        return this->MyClass;
@@ -1638,7 +1638,7 @@ void User::PurgeEmptyChannels()
                        }
                        catch (...)
                        {
-                               ServerInstance->Log(DEBUG,"Exception in User::PurgeEmptyChannels to_delete.push_back()");
+                               ServerInstance->Logs->Log("USERS", DEBUG,"Exception in User::PurgeEmptyChannels to_delete.push_back()");
                        }
                }
        }
@@ -1716,7 +1716,7 @@ void User::HandleEvent(EventType et, int errornum)
        }
        catch (...)
        {
-               ServerInstance->Log(DEBUG,"Exception in User::HandleEvent intercepted");
+               ServerInstance->Logs->Log("USERS", DEBUG,"Exception in User::HandleEvent intercepted");
        }
 
        /* If the user has raised an error whilst being processed, quit them now we're safe to */
index 547a54fea6ed564ced89b8f442333627338cae2e..19a15decf27b6e632a5637712759b58ceac9ff50 100644 (file)
@@ -410,7 +410,7 @@ void XLine::DefaultApply(User* u, const std::string &line, bool bancache)
 
        if (bancache)
        {
-               ServerInstance->Log(DEBUG, std::string("BanCache: Adding positive hit (") + line + ") for " + u->GetIPString());
+               ServerInstance->Logs->Log("BANCACHE", DEBUG, std::string("BanCache: Adding positive hit (") + line + ") for " + u->GetIPString());
                ServerInstance->BanCache->AddHit(u->GetIPString(), this->type, line + "-Lined: " + this->reason);
        }
 }