diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-11 12:26:07 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-11 12:26:07 +0000 |
commit | e84bf9f3ec5a60078c32b272d3d7885c0708c544 (patch) | |
tree | 99fc8f4b4d7bede49e91f27abcdee6fb8c4fe6f4 /src/modules | |
parent | d17465716790010b6e3221f9ce49272110276ccf (diff) |
Change to using Instance->Log (InspIRCd::Log) rather than log() macro
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4880 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
28 files changed, 349 insertions, 349 deletions
diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp index 6ba8afce3..819d77843 100644 --- a/src/modules/extra/m_filter_pcre.cpp +++ b/src/modules/extra/m_filter_pcre.cpp @@ -112,7 +112,7 @@ class ModuleFilterPCRE : public Module target = ""; } - log(DEFAULT, "Filter: %s had their notice filtered, target was %s: %s Action: %s", user->nick, target, filt.reason.c_str(), filt.action.c_str()); + ServerInstance->Log(DEFAULT, "Filter: %s had their notice filtered, target was %s: %s Action: %s", user->nick, target, filt.reason.c_str(), filt.action.c_str()); if (filt.action == "block") { @@ -151,7 +151,7 @@ class ModuleFilterPCRE : public Module throw(e); } - log(DEFAULT,"m_filter_pcre: read configuration from "+filterfile); + ServerInstance->Log(DEFAULT,"m_filter_pcre: read configuration from "+filterfile); filters.clear(); @@ -165,13 +165,13 @@ class ModuleFilterPCRE : public Module if (!re) { - log(DEFAULT,"Error in regular expression: %s at offset %d: %s\n", pattern.c_str(), erroffset, error); - log(DEFAULT,"Regular expression %s not loaded.", pattern.c_str()); + 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()); } else { filters.push_back(Filter(re, reason, action)); - log(DEFAULT,"Regular expression %s loaded.", pattern.c_str()); + ServerInstance->Log(DEFAULT,"Regular expression %s loaded.", pattern.c_str()); } } } diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index d8a20535a..d43203ac4 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -587,11 +587,11 @@ void ConnectDatabases(InspIRCd* ServerInstance) i->second->SetEnable(true); if (i->second->Connect()) { - log(DEFAULT,"SQL: Successfully connected database "+i->second->GetHost()); + ServerInstance->Log(DEFAULT,"SQL: Successfully connected database "+i->second->GetHost()); } else { - log(DEFAULT,"SQL: Failed to connect database "+i->second->GetHost()+": Error: "+i->second->GetError()); + ServerInstance->Log(DEFAULT,"SQL: Failed to connect database "+i->second->GetHost()+": Error: "+i->second->GetError()); i->second->SetEnable(false); } } @@ -600,9 +600,9 @@ void ConnectDatabases(InspIRCd* ServerInstance) void LoadDatabases(ConfigReader* ThisConf, InspIRCd* ServerInstance) { - log(DEFAULT,"SQL: Loading database settings"); + ServerInstance->Log(DEFAULT,"SQL: Loading database settings"); Connections.clear(); - log(DEBUG,"Cleared connections"); + ServerInstance->Log(DEBUG,"Cleared connections"); for (int j =0; j < ThisConf->Enumerate("database"); j++) { std::string db = ThisConf->ReadValue("database","name",j); @@ -610,13 +610,13 @@ void LoadDatabases(ConfigReader* ThisConf, InspIRCd* ServerInstance) std::string pass = ThisConf->ReadValue("database","password",j); std::string host = ThisConf->ReadValue("database","hostname",j); std::string id = ThisConf->ReadValue("database","id",j); - log(DEBUG,"Read database settings"); + ServerInstance->Log(DEBUG,"Read database settings"); if ((db != "") && (host != "") && (user != "") && (id != "") && (pass != "")) { SQLConnection* ThisSQL = new SQLConnection(host,user,pass,db,id); - log(DEFAULT,"Loaded database: "+ThisSQL->GetHost()); + ServerInstance->Log(DEFAULT,"Loaded database: "+ThisSQL->GetHost()); Connections[id] = ThisSQL; - log(DEBUG,"Pushed back connection"); + ServerInstance->Log(DEBUG,"Pushed back connection"); } } ConnectDatabases(ServerInstance); @@ -662,7 +662,7 @@ class Notifier : public InspSocket Notifier(InspIRCd* SI, int newfd, char* ip) : InspSocket(SI, newfd, ip) { - ilog(Instance,DEBUG,"Constructor of new socket"); + Instance->Log(DEBUG,"Constructor of new socket"); } /* Using getsockname and ntohs, we can determine which port number we were allocated */ @@ -677,7 +677,7 @@ class Notifier : public InspSocket virtual int OnIncomingConnection(int newsock, char* ip) { - ilog(Instance,DEBUG,"Inbound connection on fd %d!",newsock); + Instance->Log(DEBUG,"Inbound connection on fd %d!",newsock); Notifier* n = new Notifier(this->Instance, newsock, ip); this->Instance->AddSocket(n); return true; @@ -685,17 +685,17 @@ class Notifier : public InspSocket virtual bool OnDataReady() { - ilog(Instance,DEBUG,"Inbound data!"); + Instance->Log(DEBUG,"Inbound data!"); char* data = this->Read(); ConnMap::iterator iter; if (data && *data) { - ilog(Instance,DEBUG,"Looking for connection %s",data); + Instance->Log(DEBUG,"Looking for connection %s",data); /* We expect to be sent a null terminated string */ if((iter = Connections.find(data)) != Connections.end()) { - ilog(Instance,DEBUG,"Found it!"); + Instance->Log(DEBUG,"Found it!"); /* Lock the mutex, send back the data */ pthread_mutex_lock(&results_mutex); @@ -745,7 +745,7 @@ class ModuleSQL : public Module char* returnval = NULL; - log(DEBUG, "Got query: '%s' with %d replacement parameters on id '%s'", req->query.q.c_str(), req->query.p.size(), req->dbid.c_str()); + ServerInstance->Log(DEBUG, "Got query: '%s' with %d replacement parameters on id '%s'", req->query.q.c_str(), req->query.p.size(), req->dbid.c_str()); if((iter = Connections.find(req->dbid)) != Connections.end()) { @@ -764,7 +764,7 @@ class ModuleSQL : public Module return returnval; } - log(DEBUG, "Got unsupported API version string: %s", request->GetId()); + ServerInstance->Log(DEBUG, "Got unsupported API version string: %s", request->GetId()); return NULL; } @@ -780,7 +780,7 @@ class ModuleSQL : public Module MessagePipe = new Notifier(ServerInstance); ServerInstance->AddSocket(MessagePipe); - log(DEBUG,"Bound notifier to 127.0.0.1:%d",MessagePipe->GetPort()); + ServerInstance->Log(DEBUG,"Bound notifier to 127.0.0.1:%d",MessagePipe->GetPort()); pthread_attr_t attribs; pthread_attr_init(&attribs); diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index b3427261a..a60fcb5f6 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -102,7 +102,7 @@ class SQLresolver : public Resolver virtual void OnError(ResolverError e, const std::string &errormessage) { - log(DEBUG, "DNS lookup failed (%s), dying horribly", errormessage.c_str()); + ServerInstance->Log(DEBUG, "DNS lookup failed (%s), dying horribly", errormessage.c_str()); } virtual ~SQLresolver() @@ -152,7 +152,7 @@ public: void push(const SQLrequest &q) { - //log(DEBUG, "QueryQueue::push(): Adding %s query to queue: %s", ((q.pri) ? "priority" : "non-priority"), q.query.q.c_str()); + //ServerInstance->Log(DEBUG, "QueryQueue::push(): Adding %s query to queue: %s", ((q.pri) ? "priority" : "non-priority"), q.query.q.c_str()); if(q.pri) priority.push_back(q); @@ -268,7 +268,7 @@ public: rows = PQntuples(res); cols = PQnfields(res); - //log(DEBUG, "Created new PgSQL result; %d rows, %d columns, %s affected", rows, cols, PQcmdTuples(res)); + //ServerInstance->Log(DEBUG, "Created new PgSQL result; %d rows, %d columns, %s affected", rows, cols, PQcmdTuples(res)); } ~PgSQLresult() @@ -331,7 +331,7 @@ public: } else { - //log(DEBUG, "PQgetvalue returned a null pointer..nobody wants to tell us what this means"); + //ServerInstance->Log(DEBUG, "PQgetvalue returned a null pointer..nobody wants to tell us what this means"); throw SQLbadColName(); } } @@ -519,7 +519,7 @@ public: ModulePgSQL(InspIRCd* Me) : Module::Module(Me), currid(0) { - log(DEBUG, "%s 'SQL' feature", ServerInstance->PublishFeature("SQL", this) ? "Published" : "Couldn't publish"); + ServerInstance->Log(DEBUG, "%s 'SQL' feature", ServerInstance->PublishFeature("SQL", this) ? "Published" : "Couldn't publish"); sqlsuccess = new char[strlen(SQLSUCCESS)+1]; @@ -582,7 +582,7 @@ public: else { /* Invalid address family, die horribly. */ - log(DEBUG, "insp_aton failed returning -1, oh noes."); + ServerInstance->Log(DEBUG, "insp_aton failed returning -1, oh noes."); } } } @@ -604,7 +604,7 @@ public: SQLrequest* req = (SQLrequest*)request; ConnMap::iterator iter; - log(DEBUG, "Got query: '%s' with %d replacement parameters on id '%s'", req->query.q.c_str(), req->query.p.size(), req->dbid.c_str()); + ServerInstance->Log(DEBUG, "Got query: '%s' with %d replacement parameters on id '%s'", req->query.q.c_str(), req->query.p.size(), req->dbid.c_str()); if((iter = connections.find(req->dbid)) != connections.end()) { @@ -621,7 +621,7 @@ public: } } - log(DEBUG, "Got unsupported API version string: %s", request->GetId()); + ServerInstance->Log(DEBUG, "Got unsupported API version string: %s", request->GetId()); return NULL; } @@ -662,7 +662,7 @@ public: SQLConn::SQLConn(InspIRCd* SI, ModulePgSQL* self, const SQLhost& hi) : InspSocket::InspSocket(SI), us(self), dbhost(hi.host), dbport(hi.port), dbname(hi.name), dbuser(hi.user), dbpass(hi.pass), ssl(hi.ssl), sql(NULL), status(CWRITE), qinprog(false) { - //log(DEBUG, "Creating new PgSQL connection to database %s on %s:%u (%s/%s)", dbname.c_str(), dbhost.c_str(), dbport, dbuser.c_str(), dbpass.c_str()); + //ServerInstance->Log(DEBUG, "Creating new PgSQL connection to database %s on %s:%u (%s/%s)", dbname.c_str(), dbhost.c_str(), dbport, dbuser.c_str(), dbpass.c_str()); /* Some of this could be reviewed, unsure if I need to fill 'host' etc... * just copied this over from the InspSocket constructor. @@ -674,7 +674,7 @@ SQLConn::SQLConn(InspIRCd* SI, ModulePgSQL* self, const SQLhost& hi) this->ClosePending = false; - ilog(Instance,DEBUG,"No need to resolve %s", this->host); + Instance->Log(DEBUG,"No need to resolve %s", this->host); if(!this->DoConnect()) @@ -690,18 +690,18 @@ SQLConn::~SQLConn() bool SQLConn::DoConnect() { - //log(DEBUG, "SQLConn::DoConnect()"); + //ServerInstance->Log(DEBUG, "SQLConn::DoConnect()"); if(!(sql = PQconnectStart(MkInfoStr().c_str()))) { - ilog(Instance,DEBUG, "Couldn't allocate PGconn structure, aborting: %s", PQerrorMessage(sql)); + Instance->Log(DEBUG, "Couldn't allocate PGconn structure, aborting: %s", PQerrorMessage(sql)); Close(); return false; } if(PQstatus(sql) == CONNECTION_BAD) { - ilog(Instance,DEBUG, "PQconnectStart failed: %s", PQerrorMessage(sql)); + Instance->Log(DEBUG, "PQconnectStart failed: %s", PQerrorMessage(sql)); Close(); return false; } @@ -710,7 +710,7 @@ bool SQLConn::DoConnect() if(PQsetnonblocking(sql, 1) == -1) { - ilog(Instance,DEBUG, "Couldn't set connection nonblocking: %s", PQerrorMessage(sql)); + Instance->Log(DEBUG, "Couldn't set connection nonblocking: %s", PQerrorMessage(sql)); Close(); return false; } @@ -719,13 +719,13 @@ bool SQLConn::DoConnect() * and then start polling it. */ - //log(DEBUG, "Old DNS socket: %d", this->fd); + //ServerInstance->Log(DEBUG, "Old DNS socket: %d", this->fd); this->fd = PQsocket(sql); - ilog(Instance,DEBUG, "New SQL socket: %d", this->fd); + Instance->Log(DEBUG, "New SQL socket: %d", this->fd); if(this->fd <= -1) { - ilog(Instance,DEBUG, "PQsocket says we have an invalid FD: %d", this->fd); + Instance->Log(DEBUG, "PQsocket says we have an invalid FD: %d", this->fd); Close(); return false; } @@ -733,7 +733,7 @@ bool SQLConn::DoConnect() this->state = I_CONNECTING; if (!this->Instance->SE->AddFd(this->fd,false,X_ESTAB_MODULE)) { - ilog(Instance,DEBUG, "A PQsocket cant be added to the socket engine!"); + Instance->Log(DEBUG, "A PQsocket cant be added to the socket engine!"); Close(); return false; } @@ -746,7 +746,7 @@ bool SQLConn::DoConnect() void SQLConn::Close() { - ilog(Instance,DEBUG,"SQLConn::Close"); + Instance->Log(DEBUG,"SQLConn::Close"); if(this->fd > 01) Instance->socket_ref[this->fd] = NULL; @@ -769,23 +769,23 @@ bool SQLConn::DoPoll() switch(PQconnectPoll(sql)) { case PGRES_POLLING_WRITING: - //log(DEBUG, "PGconnectPoll: PGRES_POLLING_WRITING"); + //ServerInstance->Log(DEBUG, "PGconnectPoll: PGRES_POLLING_WRITING"); WantWrite(); status = CWRITE; return DoPoll(); case PGRES_POLLING_READING: - //log(DEBUG, "PGconnectPoll: PGRES_POLLING_READING"); + //ServerInstance->Log(DEBUG, "PGconnectPoll: PGRES_POLLING_READING"); status = CREAD; return true; case PGRES_POLLING_FAILED: - //log(DEBUG, "PGconnectPoll: PGRES_POLLING_FAILED: %s", PQerrorMessage(sql)); + //ServerInstance->Log(DEBUG, "PGconnectPoll: PGRES_POLLING_FAILED: %s", PQerrorMessage(sql)); return false; case PGRES_POLLING_OK: - //log(DEBUG, "PGconnectPoll: PGRES_POLLING_OK"); + //ServerInstance->Log(DEBUG, "PGconnectPoll: PGRES_POLLING_OK"); status = WWRITE; return DoConnectedPoll(); default: - //log(DEBUG, "PGconnectPoll: wtf?"); + //ServerInstance->Log(DEBUG, "PGconnectPoll: wtf?"); return true; } } @@ -801,7 +801,7 @@ bool SQLConn::DoConnectedPoll() if(PQconsumeInput(sql)) { - ilog(Instance,DEBUG, "PQconsumeInput succeeded"); + Instance->Log(DEBUG, "PQconsumeInput succeeded"); /* We just read stuff from the server, that counts as it being alive * so update the idle-since time :p @@ -810,16 +810,16 @@ bool SQLConn::DoConnectedPoll() if(PQisBusy(sql)) { - //log(DEBUG, "Still busy processing command though"); + //ServerInstance->Log(DEBUG, "Still busy processing command though"); } else if(qinprog) { - //log(DEBUG, "Looks like we have a result to process!"); + //ServerInstance->Log(DEBUG, "Looks like we have a result to process!"); /* Grab the request we're processing */ SQLrequest& query = queue.front(); - ilog(Instance,DEBUG, "ID is %lu", query.id); + Instance->Log(DEBUG, "ID is %lu", query.id); /* Get a pointer to the module we're about to return the result to */ Module* to = query.GetSource(); @@ -844,7 +844,7 @@ bool SQLConn::DoConnectedPoll() /* ..and the result */ PgSQLresult reply(us, to, query.id, result); - ilog(Instance,DEBUG, "Got result, status code: %s; error message: %s", PQresStatus(PQresultStatus(result)), PQresultErrorMessage(result)); + Instance->Log(DEBUG, "Got result, status code: %s; error message: %s", PQresStatus(PQresultStatus(result)), PQresultErrorMessage(result)); switch(PQresultStatus(result)) { @@ -867,7 +867,7 @@ bool SQLConn::DoConnectedPoll() * the pointer to NULL. We cannot just cancel the query as the result will still come * through at some point...and it could get messy if we play with invalid pointers... */ - ilog(Instance,DEBUG, "Looks like we're handling a zombie query from a module which unloaded before it got a result..fun. ID: %lu", query.id); + Instance->Log(DEBUG, "Looks like we're handling a zombie query from a module which unloaded before it got a result..fun. ID: %lu", query.id); PQclear(result); } @@ -877,7 +877,7 @@ bool SQLConn::DoConnectedPoll() } else { - ilog(Instance,DEBUG, "Eh!? We just got a read event, and connection isn't busy..but no result :("); + Instance->Log(DEBUG, "Eh!? We just got a read event, and connection isn't busy..but no result :("); } return true; @@ -889,7 +889,7 @@ bool SQLConn::DoConnectedPoll() * deserves to reconnect [/excuse] * Returning true so the core doesn't try and close the connection. */ - ilog(Instance,DEBUG, "PQconsumeInput failed: %s", PQerrorMessage(sql)); + Instance->Log(DEBUG, "PQconsumeInput failed: %s", PQerrorMessage(sql)); Reconnect(); return true; } @@ -900,23 +900,23 @@ bool SQLConn::DoResetPoll() switch(PQresetPoll(sql)) { case PGRES_POLLING_WRITING: - //log(DEBUG, "PGresetPoll: PGRES_POLLING_WRITING"); + //ServerInstance->Log(DEBUG, "PGresetPoll: PGRES_POLLING_WRITING"); WantWrite(); status = CWRITE; return DoPoll(); case PGRES_POLLING_READING: - //log(DEBUG, "PGresetPoll: PGRES_POLLING_READING"); + //ServerInstance->Log(DEBUG, "PGresetPoll: PGRES_POLLING_READING"); status = CREAD; return true; case PGRES_POLLING_FAILED: - //log(DEBUG, "PGresetPoll: PGRES_POLLING_FAILED: %s", PQerrorMessage(sql)); + //ServerInstance->Log(DEBUG, "PGresetPoll: PGRES_POLLING_FAILED: %s", PQerrorMessage(sql)); return false; case PGRES_POLLING_OK: - //log(DEBUG, "PGresetPoll: PGRES_POLLING_OK"); + //ServerInstance->Log(DEBUG, "PGresetPoll: PGRES_POLLING_OK"); status = WWRITE; return DoConnectedPoll(); default: - //log(DEBUG, "PGresetPoll: wtf?"); + //ServerInstance->Log(DEBUG, "PGresetPoll: wtf?"); return true; } } @@ -926,38 +926,38 @@ void SQLConn::ShowStatus() switch(PQstatus(sql)) { case CONNECTION_STARTED: - ilog(Instance,DEBUG, "PQstatus: CONNECTION_STARTED: Waiting for connection to be made."); + Instance->Log(DEBUG, "PQstatus: CONNECTION_STARTED: Waiting for connection to be made."); break; case CONNECTION_MADE: - ilog(Instance,DEBUG, "PQstatus: CONNECTION_MADE: Connection OK; waiting to send."); + Instance->Log(DEBUG, "PQstatus: CONNECTION_MADE: Connection OK; waiting to send."); break; case CONNECTION_AWAITING_RESPONSE: - ilog(Instance,DEBUG, "PQstatus: CONNECTION_AWAITING_RESPONSE: Waiting for a response from the server."); + Instance->Log(DEBUG, "PQstatus: CONNECTION_AWAITING_RESPONSE: Waiting for a response from the server."); break; case CONNECTION_AUTH_OK: - ilog(Instance,DEBUG, "PQstatus: CONNECTION_AUTH_OK: Received authentication; waiting for backend start-up to finish."); + Instance->Log(DEBUG, "PQstatus: CONNECTION_AUTH_OK: Received authentication; waiting for backend start-up to finish."); break; case CONNECTION_SSL_STARTUP: - ilog(Instance,DEBUG, "PQstatus: CONNECTION_SSL_STARTUP: Negotiating SSL encryption."); + Instance->Log(DEBUG, "PQstatus: CONNECTION_SSL_STARTUP: Negotiating SSL encryption."); break; case CONNECTION_SETENV: - ilog(Instance,DEBUG, "PQstatus: CONNECTION_SETENV: Negotiating environment-driven parameter settings."); + Instance->Log(DEBUG, "PQstatus: CONNECTION_SETENV: Negotiating environment-driven parameter settings."); break; default: - ilog(Instance,DEBUG, "PQstatus: ???"); + Instance->Log(DEBUG, "PQstatus: ???"); } } bool SQLConn::OnDataReady() { /* Always return true here, false would close the socket - we need to do that ourselves with the pgsql API */ - ilog(Instance,DEBUG, "OnDataReady(): status = %s", StatusStr()); + Instance->Log(DEBUG, "OnDataReady(): status = %s", StatusStr()); return DoEvent(); } @@ -965,21 +965,21 @@ bool SQLConn::OnDataReady() bool SQLConn::OnWriteReady() { /* Always return true here, false would close the socket - we need to do that ourselves with the pgsql API */ - ilog(Instance,DEBUG, "OnWriteReady(): status = %s", StatusStr()); + Instance->Log(DEBUG, "OnWriteReady(): status = %s", StatusStr()); return DoEvent(); } bool SQLConn::OnConnected() { - ilog(Instance,DEBUG, "OnConnected(): status = %s", StatusStr()); + Instance->Log(DEBUG, "OnConnected(): status = %s", StatusStr()); return DoEvent(); } bool SQLConn::Reconnect() { - ilog(Instance,DEBUG, "Initiating reconnect"); + Instance->Log(DEBUG, "Initiating reconnect"); if(PQresetStart(sql)) { @@ -992,7 +992,7 @@ bool SQLConn::Reconnect() } else { - ilog(Instance,DEBUG, "Failed to initiate reconnect...fun"); + Instance->Log(DEBUG, "Failed to initiate reconnect...fun"); return false; } } @@ -1017,13 +1017,13 @@ bool SQLConn::DoEvent() switch(PQflush(sql)) { case -1: - ilog(Instance,DEBUG, "Error flushing write queue: %s", PQerrorMessage(sql)); + Instance->Log(DEBUG, "Error flushing write queue: %s", PQerrorMessage(sql)); break; case 0: - ilog(Instance,DEBUG, "Successfully flushed write queue (or there was nothing to write)"); + Instance->Log(DEBUG, "Successfully flushed write queue (or there was nothing to write)"); break; case 1: - ilog(Instance,DEBUG, "Not all of the write queue written, triggering write event so we can have another go"); + Instance->Log(DEBUG, "Not all of the write queue written, triggering write event so we can have another go"); WantWrite(); break; } @@ -1124,10 +1124,10 @@ SQLerror SQLConn::DoQuery(SQLrequest &req) #endif if(error) { - ilog(Instance,DEBUG, "Apparently PQescapeStringConn() failed somehow...don't know how or what to do..."); + Instance->Log(DEBUG, "Apparently PQescapeStringConn() failed somehow...don't know how or what to do..."); } - ilog(Instance,DEBUG, "Appended %d bytes of escaped string onto the query", len); + Instance->Log(DEBUG, "Appended %d bytes of escaped string onto the query", len); /* Incremenet queryend to the end of the newly escaped parameter */ queryend += len; @@ -1137,7 +1137,7 @@ SQLerror SQLConn::DoQuery(SQLrequest &req) } else { - ilog(Instance,DEBUG, "Found a substitution location but no parameter to substitute :|"); + Instance->Log(DEBUG, "Found a substitution location but no parameter to substitute :|"); break; } } @@ -1151,27 +1151,27 @@ SQLerror SQLConn::DoQuery(SQLrequest &req) /* Null-terminate the query */ *queryend = 0; - ilog(Instance,DEBUG, "Attempting to dispatch query: %s", query); + Instance->Log(DEBUG, "Attempting to dispatch query: %s", query); req.query.q = query; if(PQsendQuery(sql, query)) { - ilog(Instance,DEBUG, "Dispatched query successfully"); + Instance->Log(DEBUG, "Dispatched query successfully"); qinprog = true; DELETE(query); return SQLerror(); } else { - ilog(Instance,DEBUG, "Failed to dispatch query: %s", PQerrorMessage(sql)); + Instance->Log(DEBUG, "Failed to dispatch query: %s", PQerrorMessage(sql)); DELETE(query); return SQLerror(QSEND_FAIL, PQerrorMessage(sql)); } } } - ilog(Instance,DEBUG, "Can't query until connection is complete"); + Instance->Log(DEBUG, "Can't query until connection is complete"); return SQLerror(BAD_CONN, "Can't query until connection is complete"); } diff --git a/src/modules/extra/m_sqlauth.cpp b/src/modules/extra/m_sqlauth.cpp index a5c7d5395..12bad82fc 100644 --- a/src/modules/extra/m_sqlauth.cpp +++ b/src/modules/extra/m_sqlauth.cpp @@ -50,11 +50,11 @@ public: if(SQLutils) { - log(DEBUG, "Successfully got SQLutils pointer"); + ServerInstance->Log(DEBUG, "Successfully got SQLutils pointer"); } else { - log(DEFAULT, "ERROR: This module requires a module offering the 'SQLutils' feature (usually m_sqlutils.so). Please load it and try again."); + ServerInstance->Log(DEFAULT, "ERROR: This module requires a module offering the 'SQLutils' feature (usually m_sqlutils.so). Please load it and try again."); throw ModuleException("This module requires a module offering the 'SQLutils' feature (usually m_sqlutils.so). Please load it and try again."); } @@ -117,7 +117,7 @@ public: * association. This means that if the user quits during a query we will just get a failed lookup from m_sqlutils - telling * us to discard the query. */ - log(DEBUG, "Sent query, got given ID %lu", req.id); + ServerInstance->Log(DEBUG, "Sent query, got given ID %lu", req.id); AssociateUser(this, SQLutils, req.id, user).Send(); @@ -125,7 +125,7 @@ public: } else { - log(DEBUG, "SQLrequest failed: %s", req.error.Str()); + ServerInstance->Log(DEBUG, "SQLrequest failed: %s", req.error.Str()); if (verbose) Srv->WriteOpers("Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, user->host, req.error.Str()); @@ -135,7 +135,7 @@ public: } else { - log(SPARSE, "WARNING: Couldn't find SQL provider module. NOBODY will be allowed to connect until it comes back unless they match an exception"); + ServerInstance->Log(SPARSE, "WARNING: Couldn't find SQL provider module. NOBODY will be allowed to connect until it comes back unless they match an exception"); return false; } } @@ -148,7 +148,7 @@ public: res = static_cast<SQLresult*>(request); - log(DEBUG, "Got SQL result (%s) with ID %lu", res->GetId(), res->id); + ServerInstance->Log(DEBUG, "Got SQL result (%s) with ID %lu", res->GetId(), res->id); userrec* user = GetAssocUser(this, SQLutils, res->id).S().user; UnAssociate(this, SQLutils, res->id).S(); @@ -157,8 +157,8 @@ public: { if(res->error.Id() == NO_ERROR) { - log(DEBUG, "Associated query ID %lu with user %s", res->id, user->nick); - log(DEBUG, "Got result with %d rows and %d columns", res->Rows(), res->Cols()); + ServerInstance->Log(DEBUG, "Associated query ID %lu with user %s", res->id, user->nick); + ServerInstance->Log(DEBUG, "Got result with %d rows and %d columns", res->Rows(), res->Cols()); if(res->Rows()) { @@ -174,20 +174,20 @@ public: } else if (verbose) { - log(DEBUG, "Query failed: %s", res->error.Str()); + ServerInstance->Log(DEBUG, "Query failed: %s", res->error.Str()); Srv->WriteOpers("Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, user->host, res->error.Str()); user->Extend("sqlauth_failed"); } } else { - log(DEBUG, "Got query with unknown ID, this probably means the user quit while the query was in progress"); + ServerInstance->Log(DEBUG, "Got query with unknown ID, this probably means the user quit while the query was in progress"); } return SQLSUCCESS; } - log(DEBUG, "Got unsupported API version string: %s", request->GetId()); + ServerInstance->Log(DEBUG, "Got unsupported API version string: %s", request->GetId()); return NULL; } diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp index 4db8fe6f0..ce4b23cb4 100644 --- a/src/modules/extra/m_sqllog.cpp +++ b/src/modules/extra/m_sqllog.cpp @@ -97,7 +97,7 @@ class QueryInfo } else { - //log(DEBUG, "SQLrequest failed: %s", req.error.Str()); + //ServerInstance->Log(DEBUG, "SQLrequest failed: %s", req.error.Str()); } break; } @@ -114,7 +114,7 @@ class QueryInfo } else { - //log(DEBUG, "SQLrequest failed: %s", req.error.Str()); + //ServerInstance->Log(DEBUG, "SQLrequest failed: %s", req.error.Str()); } break; @@ -146,7 +146,7 @@ class QueryInfo } else { - //log(DEBUG, "SQLrequest failed: %s", req.error.Str()); + //ServerInstance->Log(DEBUG, "SQLrequest failed: %s", req.error.Str()); } break; } @@ -162,7 +162,7 @@ class QueryInfo } else { - //log(DEBUG, "SQLrequest failed: %s", req.error.Str()); + //ServerInstance->Log(DEBUG, "SQLrequest failed: %s", req.error.Str()); } break; case FIND_HOST: @@ -194,7 +194,7 @@ class QueryInfo } else { - //log(DEBUG, "SQLrequest failed: %s", req.error.Str()); + //ServerInstance->Log(DEBUG, "SQLrequest failed: %s", req.error.Str()); } break; } @@ -211,7 +211,7 @@ class QueryInfo } else { - //log(DEBUG, "SQLrequest failed: %s", req.error.Str()); + //ServerInstance->Log(DEBUG, "SQLrequest failed: %s", req.error.Str()); } break; case INSERT_LOGENTRY: @@ -237,7 +237,7 @@ class QueryInfo } else { - //log(DEBUG, "SQLrequest failed: %s", req.error.Str()); + //ServerInstance->Log(DEBUG, "SQLrequest failed: %s", req.error.Str()); } } break; @@ -264,7 +264,7 @@ class ModuleSQLLog : public Module SQLModule = Srv->FindFeature("SQL"); if (!SQLModule) - log(DEFAULT,"WARNING: m_sqllog.so could not initialize because an SQL module is not loaded. Load the module and rehash your server."); + ServerInstance->Log(DEFAULT,"WARNING: m_sqllog.so could not initialize because an SQL module is not loaded. Load the module and rehash your server."); return (SQLModule); } @@ -290,20 +290,20 @@ class ModuleSQLLog : public Module virtual char* OnRequest(Request* request) { - log(DEBUG,"OnRequest in m_sqllog.so"); + ServerInstance->Log(DEBUG,"OnRequest in m_sqllog.so"); if(strcmp(SQLRESID, request->GetId()) == 0) { SQLresult* res; std::map<unsigned long, QueryInfo*>::iterator n; res = static_cast<SQLresult*>(request); - log(DEBUG, "Got SQL result (%s) with ID %lu", res->GetId(), res->id); + ServerInstance->Log(DEBUG, "Got SQL result (%s) with ID %lu", res->GetId(), res->id); n = active_queries.find(res->id); if (n != active_queries.end()) { - log(DEBUG,"This is an active query"); + ServerInstance->Log(DEBUG,"This is an active query"); n->second->Go(res); std::map<unsigned long, QueryInfo*>::iterator n = active_queries.find(res->id); @@ -325,11 +325,11 @@ class ModuleSQLLog : public Module QueryInfo* i = new QueryInfo(nick, host, req.id, category); i->qs = FIND_SOURCE; active_queries[req.id] = i; - log(DEBUG,"Active query id %d",req.id); + ServerInstance->Log(DEBUG,"Active query id %d",req.id); } else { - log(DEBUG, "SQLrequest failed: %s", req.error.Str()); + ServerInstance->Log(DEBUG, "SQLrequest failed: %s", req.error.Str()); } /*long nickid = InsertNick(nick); diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp index e0cba9160..4ae07b3de 100644 --- a/src/modules/extra/m_sqloper.cpp +++ b/src/modules/extra/m_sqloper.cpp @@ -42,11 +42,11 @@ public: if (SQLutils) { - log(DEBUG, "Successfully got SQLutils pointer"); + ServerInstance->Log(DEBUG, "Successfully got SQLutils pointer"); } else { - log(DEFAULT, "ERROR: This module requires a module offering the 'SQLutils' feature (usually m_sqlutils.so). Please load it and try again."); + ServerInstance->Log(DEFAULT, "ERROR: This module requires a module offering the 'SQLutils' feature (usually m_sqlutils.so). Please load it and try again."); throw ModuleException("This module requires a module offering the 'SQLutils' feature (usually m_sqlutils.so). Please load it and try again."); } @@ -100,7 +100,7 @@ public: * association. This means that if the user quits during a query we will just get a failed lookup from m_sqlutils - telling * us to discard the query. */ - log(DEBUG, "Sent query, got given ID %lu", req.id); + ServerInstance->Log(DEBUG, "Sent query, got given ID %lu", req.id); AssociateUser(this, SQLutils, req.id, user).Send(); @@ -108,14 +108,14 @@ public: } else { - log(DEBUG, "SQLrequest failed: %s", req.error.Str()); + ServerInstance->Log(DEBUG, "SQLrequest failed: %s", req.error.Str()); return false; } } else { - log(SPARSE, "WARNING: Couldn't find SQL provider module. NOBODY will be able to oper up unless their o:line is statically configured"); + ServerInstance->Log(SPARSE, "WARNING: Couldn't find SQL provider module. NOBODY will be able to oper up unless their o:line is statically configured"); return false; } } @@ -128,7 +128,7 @@ public: res = static_cast<SQLresult*>(request); - log(DEBUG, "Got SQL result (%s) with ID %lu", res->GetId(), res->id); + ServerInstance->Log(DEBUG, "Got SQL result (%s) with ID %lu", res->GetId(), res->id); userrec* user = GetAssocUser(this, SQLutils, res->id).S().user; UnAssociate(this, SQLutils, res->id).S(); @@ -137,8 +137,8 @@ public: { if (res->error.Id() == NO_ERROR) { - log(DEBUG, "Associated query ID %lu with user %s", res->id, user->nick); - log(DEBUG, "Got result with %d rows and %d columns", res->Rows(), res->Cols()); + ServerInstance->Log(DEBUG, "Associated query ID %lu with user %s", res->id, user->nick); + ServerInstance->Log(DEBUG, "Got result with %d rows and %d columns", res->Rows(), res->Cols()); if (res->Rows()) { @@ -157,7 +157,7 @@ public: for (SQLfieldMap& row = res->GetRowMap(); row.size(); row = res->GetRowMap()) { - log(DEBUG, "Trying to oper user %s with username = '%s', passhash = '%s', hostname = '%s', type = '%s'", user->nick, row["username"].d.c_str(), row["password"].d.c_str(), row["hostname"].d.c_str(), row["type"].d.c_str()); + ServerInstance->Log(DEBUG, "Trying to oper user %s with username = '%s', passhash = '%s', hostname = '%s', type = '%s'", user->nick, row["username"].d.c_str(), row["password"].d.c_str(), row["hostname"].d.c_str(), row["type"].d.c_str()); if (OperUser(user, row["username"].d, row["password"].d, row["hostname"].d, row["type"].d)) { @@ -175,7 +175,7 @@ public: user->WriteServ( "491 %s :Invalid oper credentials", user->nick); Srv->WriteOpers("*** WARNING! Failed oper attempt by %s!%s@%s!", user->nick, user->ident, user->host); - log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: user, host or password did not match.", user->nick, user->ident, user->host); + ServerInstance->Log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: user, host or password did not match.", user->nick, user->ident, user->host); } } else @@ -184,22 +184,22 @@ public: * We have to fail the /oper request and give them the same error * as above. */ - log(DEBUG, "Query failed: %s", res->error.Str()); + ServerInstance->Log(DEBUG, "Query failed: %s", res->error.Str()); user->WriteServ( "491 %s :Invalid oper credentials", user->nick); Srv->WriteOpers("*** WARNING! Failed oper attempt by %s!%s@%s! (SQL query failed: %s)", user->nick, user->ident, user->host, res->error.Str()); - log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: user, host or password did not match.", user->nick, user->ident, user->host); + ServerInstance->Log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: user, host or password did not match.", user->nick, user->ident, user->host); } } else { - log(DEBUG, "Got query with unknown ID, this probably means the user quit while the query was in progress"); + ServerInstance->Log(DEBUG, "Got query with unknown ID, this probably means the user quit while the query was in progress"); } return SQLSUCCESS; } - log(DEBUG, "Got unsupported API version string: %s", request->GetId()); + ServerInstance->Log(DEBUG, "Got unsupported API version string: %s", request->GetId()); return NULL; } @@ -212,7 +212,7 @@ public: { std::string tname = Conf.ReadValue("type","name",j); - log(DEBUG, "Scanning opertype: %s", tname.c_str()); + ServerInstance->Log(DEBUG, "Scanning opertype: %s", tname.c_str()); std::string hostname(user->ident); hostname.append("@").append(user->host); @@ -220,7 +220,7 @@ public: if ((tname == type) && OneOfMatches(hostname.c_str(), user->GetIPString(), pattern.c_str())) { /* Opertype and host match, looks like this is it. */ - log(DEBUG, "Host (%s matched %s OR %s) and type (%s)", pattern.c_str(), hostname.c_str(), user->GetIPString(), type.c_str()); + ServerInstance->Log(DEBUG, "Host (%s matched %s OR %s) and type (%s)", pattern.c_str(), hostname.c_str(), user->GetIPString(), type.c_str()); std::string operhost = Conf.ReadValue("type", "host", j); diff --git a/src/modules/extra/m_sqlutils.cpp b/src/modules/extra/m_sqlutils.cpp index ee9ebf8b4..8cddacd42 100644 --- a/src/modules/extra/m_sqlutils.cpp +++ b/src/modules/extra/m_sqlutils.cpp @@ -49,7 +49,7 @@ public: ModuleSQLutils(InspIRCd* Me) : Module::Module(Me) { - log(DEBUG, "%s 'SQLutils' feature", ServerInstance->PublishFeature("SQLutils", this) ? "Published" : "Couldn't publish"); + ServerInstance->Log(DEBUG, "%s 'SQLutils' feature", ServerInstance->PublishFeature("SQLutils", this) ? "Published" : "Couldn't publish"); } void Implements(char* List) @@ -63,7 +63,7 @@ public: { AssociateUser* req = (AssociateUser*)request; - log(DEBUG, "Associated ID %lu with user %s", req->id, req->user->nick); + ServerInstance->Log(DEBUG, "Associated ID %lu with user %s", req->id, req->user->nick); iduser.insert(std::make_pair(req->id, req->user)); @@ -73,7 +73,7 @@ public: { AssociateChan* req = (AssociateChan*)request; - log(DEBUG, "Associated ID %lu with channel %s", req->id, req->chan->name); + ServerInstance->Log(DEBUG, "Associated ID %lu with channel %s", req->id, req->chan->name); idchan.insert(std::make_pair(req->id, req->chan)); @@ -87,7 +87,7 @@ public: * it is associated with. */ - log(DEBUG, "Unassociating ID %lu with all users and channels", req->id); + ServerInstance->Log(DEBUG, "Unassociating ID %lu with all users and channels", req->id); DoUnAssociate(iduser, req->id); DoUnAssociate(idchan, req->id); @@ -98,11 +98,11 @@ public: IdUserMap::iterator iter = iduser.find(req->id); - log(DEBUG, "Looking up user associated with ID %lu", req->id); + ServerInstance->Log(DEBUG, "Looking up user associated with ID %lu", req->id); if(iter != iduser.end()) { - log(DEBUG, "Found user %s", iter->second->nick); + ServerInstance->Log(DEBUG, "Found user %s", iter->second->nick); req->user = iter->second; } } @@ -112,17 +112,17 @@ public: IdChanMap::iterator iter = idchan.find(req->id); - log(DEBUG, "Looking up channel associated with ID %lu", req->id); + ServerInstance->Log(DEBUG, "Looking up channel associated with ID %lu", req->id); if(iter != idchan.end()) { - log(DEBUG, "Found channel %s", iter->second->name); + ServerInstance->Log(DEBUG, "Found channel %s", iter->second->name); req->chan = iter->second; } } else { - log(DEBUG, "Got unsupported API version string: %s", request->GetId()); + ServerInstance->Log(DEBUG, "Got unsupported API version string: %s", request->GetId()); return NULL; } @@ -149,18 +149,18 @@ public: { if(iter->second == user) { - log(DEBUG, "Erased query from map associated with quitting user %s", user->nick); + ServerInstance->Log(DEBUG, "Erased query from map associated with quitting user %s", user->nick); } else { - log(DEBUG, "BUG: ID associated with user %s doesn't have the same userrec* associated with it in the map (erasing anyway)", user->nick); + ServerInstance->Log(DEBUG, "BUG: ID associated with user %s doesn't have the same userrec* associated with it in the map (erasing anyway)", user->nick); } iduser.erase(iter); } else { - log(DEBUG, "BUG: user %s was extended with sqlutils_queryids but there was nothing matching in the map", user->nick); + ServerInstance->Log(DEBUG, "BUG: user %s was extended with sqlutils_queryids but there was nothing matching in the map", user->nick); } } @@ -218,11 +218,11 @@ public: */ RemoveFromList(iter->second, id); - log(DEBUG, "Removed query %lu from map and removed references to it on value", id); + ServerInstance->Log(DEBUG, "Removed query %lu from map and removed references to it on value", id); } else { - log(DEBUG, "Nothing associated with query %lu", id); + ServerInstance->Log(DEBUG, "Nothing associated with query %lu", id); } } @@ -246,18 +246,18 @@ public: { if(iter->second == chan) { - log(DEBUG, "Erased query from map associated with dying channnel %s", chan->name); + ServerInstance->Log(DEBUG, "Erased query from map associated with dying channnel %s", chan->name); } else { - log(DEBUG, "BUG: ID associated with channel %s doesn't have the same chanrec* associated with it in the map (erasing anyway)", chan->name); + ServerInstance->Log(DEBUG, "BUG: ID associated with channel %s doesn't have the same chanrec* associated with it in the map (erasing anyway)", chan->name); } idchan.erase(iter); } else { - log(DEBUG, "BUG: channel %s was extended with sqlutils_queryids but there was nothing matching in the map", chan->name); + ServerInstance->Log(DEBUG, "BUG: channel %s was extended with sqlutils_queryids but there was nothing matching in the map", chan->name); } } diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index fd18f51f1..b33213c14 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -79,11 +79,11 @@ class ModuleSSLGnuTLS : public Module gnutls_global_init(); // This must be called once in the program if(gnutls_certificate_allocate_credentials(&x509_cred) != 0) - log(DEFAULT, "m_ssl_gnutls.so: Failed to allocate certificate credentials"); + ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Failed to allocate certificate credentials"); // Guessing return meaning if(gnutls_dh_params_init(&dh_params) < 0) - log(DEFAULT, "m_ssl_gnutls.so: Failed to initialise DH parameters"); + ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Failed to initialise DH parameters"); // Needs the flag as it ignores a plain /rehash OnRehash("ssl"); @@ -118,11 +118,11 @@ class ModuleSSLGnuTLS : public Module // We keep a record of which ports we're listening on with SSL listenports.push_back(port); - log(DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %d", port); + ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %d", port); } else { - log(DEFAULT, "m_ssl_gnutls.so: FAILED to enable SSL on port %d, maybe you have another ssl or similar module loaded?", port); + ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: FAILED to enable SSL on port %d, maybe you have another ssl or similar module loaded?", port); } } } @@ -167,14 +167,14 @@ class ModuleSSLGnuTLS : public Module keyfile = confdir + keyfile; if(gnutls_certificate_set_x509_trust_file(x509_cred, cafile.c_str(), GNUTLS_X509_FMT_PEM) < 0) - log(DEFAULT, "m_ssl_gnutls.so: Failed to set X.509 trust file: %s", cafile.c_str()); + ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Failed to set X.509 trust file: %s", cafile.c_str()); if(gnutls_certificate_set_x509_crl_file (x509_cred, crlfile.c_str(), GNUTLS_X509_FMT_PEM) < 0) - log(DEFAULT, "m_ssl_gnutls.so: Failed to set X.509 CRL file: %s", crlfile.c_str()); + ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Failed to set X.509 CRL file: %s", crlfile.c_str()); // Guessing on the return value of this, manual doesn't say :| if(gnutls_certificate_set_x509_key_file (x509_cred, certfile.c_str(), keyfile.c_str(), GNUTLS_X509_FMT_PEM) < 0) - log(DEFAULT, "m_ssl_gnutls.so: Failed to set X.509 certificate and key files: %s and %s", certfile.c_str(), keyfile.c_str()); + ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Failed to set X.509 certificate and key files: %s and %s", certfile.c_str(), keyfile.c_str()); // This may be on a large (once a day or week) timer eventually. GenerateDHParams(); @@ -190,7 +190,7 @@ class ModuleSSLGnuTLS : public Module // security requirements. if(gnutls_dh_params_generate2(dh_params, dh_bits) < 0) - log(DEFAULT, "m_ssl_gnutls.so: Failed to generate DH parameters (%d bits)", dh_bits); + ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Failed to generate DH parameters (%d bits)", dh_bits); } virtual ~ModuleSSLGnuTLS() @@ -211,7 +211,7 @@ class ModuleSSLGnuTLS : public Module { // User is using SSL, they're a local user, and they're using one of *our* SSL ports. // Potentially there could be multiple SSL modules loaded at once on different ports. - log(DEBUG, "m_ssl_gnutls.so: Adding user %s to cull list", user->nick); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: Adding user %s to cull list", user->nick); culllist->AddItem(user, "SSL module unloading"); } } @@ -223,7 +223,7 @@ class ModuleSSLGnuTLS : public Module { // We're being unloaded, kill all the users added to the cull list in OnCleanup int numusers = culllist->Apply(); - log(DEBUG, "m_ssl_gnutls.so: Killed %d users for unload of GnuTLS SSL module", numusers); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: Killed %d users for unload of GnuTLS SSL module", numusers); for(unsigned int i = 0; i < listenports.size(); i++) ServerInstance->Config->DelIOHook(listenports[i]); @@ -271,7 +271,7 @@ class ModuleSSLGnuTLS : public Module virtual void OnRawSocketClose(int fd) { - log(DEBUG, "OnRawSocketClose: %d", fd); + ServerInstance->Log(DEBUG, "OnRawSocketClose: %d", fd); CloseSession(&sessions[fd]); } @@ -281,13 +281,13 @@ class ModuleSSLGnuTLS : public Module if(!session->sess) { - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead: No session to read from"); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead: No session to read from"); readresult = 0; CloseSession(session); return 1; } - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead(%d, buffer, %u, %d)", fd, count, readresult); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead(%d, buffer, %u, %d)", fd, count, readresult); if(session->status == ISSL_HANDSHAKING_READ) { @@ -296,18 +296,18 @@ class ModuleSSLGnuTLS : public Module if(Handshake(session)) { // Handshake successfully resumed. - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead: successfully resumed handshake"); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead: successfully resumed handshake"); } else { // Couldn't resume handshake. - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead: failed to resume handshake"); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead: failed to resume handshake"); return -1; } } else if(session->status == ISSL_HANDSHAKING_WRITE) { - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead: handshake wants to write data but we are currently reading"); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead: handshake wants to write data but we are currently reading"); return -1; } @@ -317,14 +317,14 @@ class ModuleSSLGnuTLS : public Module { // Is this right? Not sure if the unencrypted data is garaunteed to be the same length. // Read into the inbuffer, offset from the beginning by the amount of data we have that insp hasn't taken yet. - log(DEBUG, "m_ssl_gnutls.so: gnutls_record_recv(sess, inbuf+%d, %d-%d)", session->inbufoffset, inbufsize, session->inbufoffset); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: gnutls_record_recv(sess, inbuf+%d, %d-%d)", session->inbufoffset, inbufsize, session->inbufoffset); int ret = gnutls_record_recv(session->sess, session->inbuf + session->inbufoffset, inbufsize - session->inbufoffset); if(ret == 0) { // Client closed connection. - log(DEBUG, "m_ssl_gnutls.so: Client closed the connection"); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: Client closed the connection"); readresult = 0; CloseSession(session); return 1; @@ -333,12 +333,12 @@ class ModuleSSLGnuTLS : public Module { if(ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED) { - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead: Not all SSL data read: %s", gnutls_strerror(ret)); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead: Not all SSL data read: %s", gnutls_strerror(ret)); return -1; } else { - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead: Error reading SSL data: %s", gnutls_strerror(ret)); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead: Error reading SSL data: %s", gnutls_strerror(ret)); readresult = 0; CloseSession(session); } @@ -351,7 +351,7 @@ class ModuleSSLGnuTLS : public Module unsigned int length = ret + session->inbufoffset; - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead: Read %d bytes, now have %d waiting to be passed up", ret, length); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead: Read %d bytes, now have %d waiting to be passed up", ret, length); if(count <= length) { @@ -376,7 +376,7 @@ class ModuleSSLGnuTLS : public Module } else if(session->status == ISSL_CLOSING) { - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead: session closing..."); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketRead: session closing..."); readresult = 0; } @@ -390,7 +390,7 @@ class ModuleSSLGnuTLS : public Module if(!session->sess) { - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: No session to write to"); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: No session to write to"); CloseSession(session); return 1; } @@ -402,20 +402,20 @@ class ModuleSSLGnuTLS : public Module if(Handshake(session)) { // Handshake successfully resumed. - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: successfully resumed handshake"); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: successfully resumed handshake"); } else { // Couldn't resume handshake. - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: failed to resume handshake"); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: failed to resume handshake"); } } else if(session->status == ISSL_HANDSHAKING_READ) { - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: handshake wants to read data but we are currently writing"); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: handshake wants to read data but we are currently writing"); } - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: Adding %d bytes to the outgoing buffer", count); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: Adding %d bytes to the outgoing buffer", count); session->outbuf.append(sendbuffer, count); sendbuffer = session->outbuf.c_str(); count = session->outbuf.size(); @@ -426,30 +426,30 @@ class ModuleSSLGnuTLS : public Module if(ret == 0) { - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: Client closed the connection"); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: Client closed the connection"); CloseSession(session); } else if(ret < 0) { if(ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED) { - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: Not all SSL data written: %s", gnutls_strerror(ret)); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: Not all SSL data written: %s", gnutls_strerror(ret)); } else { - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: Error writing SSL data: %s", gnutls_strerror(ret)); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: Error writing SSL data: %s", gnutls_strerror(ret)); CloseSession(session); } } else { - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: Successfully wrote %d bytes", ret); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: Successfully wrote %d bytes", ret); session->outbuf = session->outbuf.substr(ret); } } else if(session->status == ISSL_CLOSING) { - log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: session closing..."); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: OnRawSocketWrite: session closing..."); } return 1; @@ -508,13 +508,13 @@ class ModuleSSLGnuTLS : public Module { // gnutls_handshake() wants to read() again. session->status = ISSL_HANDSHAKING_READ; - log(DEBUG, "m_ssl_gnutls.so: Handshake needs resuming (reading) later, error string: %s", gnutls_strerror(ret)); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: Handshake needs resuming (reading) later, error string: %s", gnutls_strerror(ret)); } else { // gnutls_handshake() wants to write() again. session->status = ISSL_HANDSHAKING_WRITE; - log(DEBUG, "m_ssl_gnutls.so: Handshake needs resuming (writing) later, error string: %s", gnutls_strerror(ret)); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: Handshake needs resuming (writing) later, error string: %s", gnutls_strerror(ret)); MakePollWrite(session); } } @@ -522,7 +522,7 @@ class ModuleSSLGnuTLS : public Module { // Handshake failed. CloseSession(session); - log(DEBUG, "m_ssl_gnutls.so: Handshake failed, error string: %s", gnutls_strerror(ret)); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: Handshake failed, error string: %s", gnutls_strerror(ret)); session->status = ISSL_CLOSING; } @@ -531,7 +531,7 @@ class ModuleSSLGnuTLS : public Module else { // Handshake complete. - log(DEBUG, "m_ssl_gnutls.so: Handshake completed"); + ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: Handshake completed"); // This will do for setting the ssl flag...it could be done earlier if it's needed. But this seems neater. userrec* extendme = ServerInstance->FindDescriptor(session->fd); diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index a019d84ab..a1cb6c4c4 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -128,11 +128,11 @@ class ModuleSSLOpenSSL : public Module // We keep a record of which ports we're listening on with SSL listenports.push_back(port); - log(DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %d", port); + ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %d", port); } else { - log(DEFAULT, "m_ssl_openssl.so: FAILED to enable SSL on port %d, maybe you have another ssl or similar module loaded?", port); + ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: FAILED to enable SSL on port %d, maybe you have another ssl or similar module loaded?", port); } } } @@ -182,18 +182,18 @@ class ModuleSSLOpenSSL : public Module /* Load our keys and certificates*/ if(!SSL_CTX_use_certificate_chain_file(ctx, certfile.c_str())) { - log(DEFAULT, "m_ssl_openssl.so: Can't read certificate file %s", certfile.c_str()); + ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: Can't read certificate file %s", certfile.c_str()); } if(!SSL_CTX_use_PrivateKey_file(ctx, keyfile.c_str(), SSL_FILETYPE_PEM)) { - log(DEFAULT, "m_ssl_openssl.so: Can't read key file %s", keyfile.c_str()); + ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: Can't read key file %s", keyfile.c_str()); } /* Load the CAs we trust*/ if(!SSL_CTX_load_verify_locations(ctx, cafile.c_str(), 0)) { - log(DEFAULT, "m_ssl_openssl.so: Can't read CA list from ", cafile.c_str()); + ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: Can't read CA list from ", cafile.c_str()); } FILE* dhpfile = fopen(dhfile.c_str(), "r"); @@ -201,7 +201,7 @@ class ModuleSSLOpenSSL : public Module if(dhpfile == NULL) { - log(DEFAULT, "m_ssl_openssl.so Couldn't open DH file %s: %s", dhfile.c_str(), strerror(errno)); + ServerInstance->Log(DEFAULT, "m_ssl_openssl.so Couldn't open DH file %s: %s", dhfile.c_str(), strerror(errno)); throw ModuleException(); } else @@ -210,7 +210,7 @@ class ModuleSSLOpenSSL : public Module if(SSL_CTX_set_tmp_dh(ctx, ret) < 0) { - log(DEFAULT, "m_ssl_openssl.so: Couldn't set DH parameters"); + ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: Couldn't set DH parameters"); } } @@ -235,7 +235,7 @@ class ModuleSSLOpenSSL : public Module { // User is using SSL, they're a local user, and they're using one of *our* SSL ports. // Potentially there could be multiple SSL modules loaded at once on different ports. - log(DEBUG, "m_ssl_openssl.so: Adding user %s to cull list", user->nick); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: Adding user %s to cull list", user->nick); culllist->AddItem(user, "SSL module unloading"); } } @@ -247,7 +247,7 @@ class ModuleSSLOpenSSL : public Module { // We're being unloaded, kill all the users added to the cull list in OnCleanup int numusers = culllist->Apply(); - log(DEBUG, "m_ssl_openssl.so: Killed %d users for unload of OpenSSL SSL module", numusers); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: Killed %d users for unload of OpenSSL SSL module", numusers); for(unsigned int i = 0; i < listenports.size(); i++) ServerInstance->Config->DelIOHook(listenports[i]); @@ -277,13 +277,13 @@ class ModuleSSLOpenSSL : public Module if(session->sess == NULL) { - log(DEBUG, "m_ssl.so: Couldn't create SSL object: %s", get_error()); + ServerInstance->Log(DEBUG, "m_ssl.so: Couldn't create SSL object: %s", get_error()); return; } if(SSL_set_fd(session->sess, fd) == 0) { - log(DEBUG, "m_ssl.so: Couldn't set fd for SSL object: %s", get_error()); + ServerInstance->Log(DEBUG, "m_ssl.so: Couldn't set fd for SSL object: %s", get_error()); return; } @@ -292,7 +292,7 @@ class ModuleSSLOpenSSL : public Module virtual void OnRawSocketClose(int fd) { - log(DEBUG, "m_ssl_openssl.so: OnRawSocketClose: %d", fd); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: OnRawSocketClose: %d", fd); CloseSession(&sessions[fd]); } @@ -302,13 +302,13 @@ class ModuleSSLOpenSSL : public Module if(!session->sess) { - log(DEBUG, "m_ssl_openssl.so: OnRawSocketRead: No session to read from"); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: OnRawSocketRead: No session to read from"); readresult = 0; CloseSession(session); return 1; } - log(DEBUG, "m_ssl_openssl.so: OnRawSocketRead(%d, buffer, %u, %d)", fd, count, readresult); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: OnRawSocketRead(%d, buffer, %u, %d)", fd, count, readresult); if(session->status == ISSL_HANDSHAKING) { @@ -318,18 +318,18 @@ class ModuleSSLOpenSSL : public Module if(Handshake(session)) { // Handshake successfully resumed. - log(DEBUG, "m_ssl_openssl.so: OnRawSocketRead: successfully resumed handshake"); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: OnRawSocketRead: successfully resumed handshake"); } else { // Couldn't resume handshake. - log(DEBUG, "m_ssl_openssl.so: OnRawSocketRead: failed to resume handshake"); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: OnRawSocketRead: failed to resume handshake"); return -1; } } else { - log(DEBUG, "m_ssl_openssl.so: OnRawSocketRead: handshake wants to write data but we are currently reading"); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: OnRawSocketRead: handshake wants to write data but we are currently reading"); return -1; } } @@ -388,12 +388,12 @@ class ModuleSSLOpenSSL : public Module if(!session->sess) { - log(DEBUG, "m_ssl_openssl.so: OnRawSocketWrite: No session to write to"); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: OnRawSocketWrite: No session to write to"); CloseSession(session); return 1; } - log(DEBUG, "m_ssl_openssl.so: OnRawSocketWrite: Adding %d bytes to the outgoing buffer", count); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: OnRawSocketWrite: Adding %d bytes to the outgoing buffer", count); session->outbuf.append(buffer, count); if(session->status == ISSL_HANDSHAKING) @@ -404,17 +404,17 @@ class ModuleSSLOpenSSL : public Module if(Handshake(session)) { // Handshake successfully resumed. - log(DEBUG, "m_ssl_openssl.so: OnRawSocketWrite: successfully resumed handshake"); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: OnRawSocketWrite: successfully resumed handshake"); } else { // Couldn't resume handshake. - log(DEBUG, "m_ssl_openssl.so: OnRawSocketWrite: failed to resume handshake"); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: OnRawSocketWrite: failed to resume handshake"); } } else { - log(DEBUG, "m_ssl_openssl.so: OnRawSocketWrite: handshake wants to read data but we are currently writing"); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: OnRawSocketWrite: handshake wants to read data but we are currently writing"); } } @@ -440,7 +440,7 @@ class ModuleSSLOpenSSL : public Module if(ret == 0) { - log(DEBUG, "m_ssl_openssl.so: DoWrite: Client closed the connection"); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: DoWrite: Client closed the connection"); CloseSession(session); return 0; } @@ -450,26 +450,26 @@ class ModuleSSLOpenSSL : public Module if(err == SSL_ERROR_WANT_WRITE) { - log(DEBUG, "m_ssl_openssl.so: DoWrite: Not all SSL data written, need to retry: %s", get_error()); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: DoWrite: Not all SSL data written, need to retry: %s", get_error()); session->wstat = ISSL_WRITE; return -1; } else if(err == SSL_ERROR_WANT_READ) { - log(DEBUG, "m_ssl_openssl.so: DoWrite: Not all SSL data written but the damn thing wants to read instead: %s", get_error()); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: DoWrite: Not all SSL data written but the damn thing wants to read instead: %s", get_error()); session->wstat = ISSL_READ; return -1; } else { - log(DEBUG, "m_ssl_openssl.so: DoWrite: Error writing SSL data: %s", get_error()); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: DoWrite: Error writing SSL data: %s", get_error()); CloseSession(session); return 0; } } else { - log(DEBUG, "m_ssl_openssl.so: DoWrite: Successfully wrote %d bytes", ret); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: DoWrite: Successfully wrote %d bytes", ret); session->outbuf = session->outbuf.substr(ret); return ret; } @@ -479,14 +479,14 @@ class ModuleSSLOpenSSL : public Module { // Is this right? Not sure if the unencrypted data is garaunteed to be the same length. // Read into the inbuffer, offset from the beginning by the amount of data we have that insp hasn't taken yet. - log(DEBUG, "m_ssl_openssl.so: DoRead: SSL_read(sess, inbuf+%d, %d-%d)", session->inbufoffset, inbufsize, session->inbufoffset); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: DoRead: SSL_read(sess, inbuf+%d, %d-%d)", session->inbufoffset, inbufsize, session->inbufoffset); int ret = SSL_read(session->sess, session->inbuf + session->inbufoffset, inbufsize - session->inbufoffset); if(ret == 0) { // Client closed connection. - log(DEBUG, "m_ssl_openssl.so: DoRead: Client closed the connection"); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: DoRead: Client closed the connection"); CloseSession(session); return 0; } @@ -496,19 +496,19 @@ class ModuleSSLOpenSSL : public Module if(err == SSL_ERROR_WANT_READ) { - log(DEBUG, "m_ssl_openssl.so: DoRead: Not all SSL data read, need to retry: %s", get_error()); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: DoRead: Not all SSL data read, need to retry: %s", get_error()); session->rstat = ISSL_READ; return -1; } else if(err == SSL_ERROR_WANT_WRITE) { - log(DEBUG, "m_ssl_openssl.so: DoRead: Not all SSL data read but the damn thing wants to write instead: %s", get_error()); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: DoRead: Not all SSL data read but the damn thing wants to write instead: %s", get_error()); session->rstat = ISSL_WRITE; return -1; } else { - log(DEBUG, "m_ssl_openssl.so: DoRead: Error reading SSL data: %s", get_error()); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: DoRead: Error reading SSL data: %s", get_error()); CloseSession(session); return 0; } @@ -519,7 +519,7 @@ class ModuleSSLOpenSSL : public Module // There are 'ret' + 'inbufoffset' bytes of data in 'inbuf' // 'buffer' is 'count' long - log(DEBUG, "m_ssl_openssl.so: DoRead: Read %d bytes, now have %d waiting to be passed up", ret, ret + session->inbufoffset); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: DoRead: Read %d bytes, now have %d waiting to be passed up", ret, ret + session->inbufoffset); session->inbufoffset += ret; @@ -576,20 +576,20 @@ class ModuleSSLOpenSSL : public Module if(err == SSL_ERROR_WANT_READ) { - log(DEBUG, "m_ssl_openssl.so: Handshake: Not completed, need to read again: %s", get_error()); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: Handshake: Not completed, need to read again: %s", get_error()); session->rstat = ISSL_READ; session->status = ISSL_HANDSHAKING; } else if(err == SSL_ERROR_WANT_WRITE) { - log(DEBUG, "m_ssl_openssl.so: Handshake: Not completed, need to write more data: %s", get_error()); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: Handshake: Not completed, need to write more data: %s", get_error()); session->wstat = ISSL_WRITE; session->status = ISSL_HANDSHAKING; MakePollWrite(session); } else { - log(DEBUG, "m_ssl_openssl.so: Handshake: Failed, bailing: %s", get_error()); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: Handshake: Failed, bailing: %s", get_error()); CloseSession(session); } @@ -598,7 +598,7 @@ class ModuleSSLOpenSSL : public Module else { // Handshake complete. - log(DEBUG, "m_ssl_openssl.so: Handshake completed"); + ServerInstance->Log(DEBUG, "m_ssl_openssl.so: Handshake completed"); // This will do for setting the ssl flag...it could be done earlier if it's needed. But this seems neater. userrec* u = ServerInstance->FindDescriptor(session->fd); diff --git a/src/modules/extra/m_testclient.cpp b/src/modules/extra/m_testclient.cpp index 10229dd99..e9696ed95 100644 --- a/src/modules/extra/m_testclient.cpp +++ b/src/modules/extra/m_testclient.cpp @@ -41,11 +41,11 @@ public: if(foo.Send()) { - log(DEBUG, "Sent query, got given ID %lu", foo.id); + ServerInstance->Log(DEBUG, "Sent query, got given ID %lu", foo.id); } else { - log(DEBUG, "SQLrequest failed: %s", foo.error.Str()); + ServerInstance->Log(DEBUG, "SQLrequest failed: %s", foo.error.Str()); } } } @@ -54,7 +54,7 @@ public: { if(strcmp(SQLRESID, request->GetId()) == 0) { - log(DEBUG, "Got SQL result (%s)", request->GetId()); + ServerInstance->Log(DEBUG, "Got SQL result (%s)", request->GetId()); SQLresult* res = (SQLresult*)request; @@ -62,33 +62,33 @@ public: { if(res->Cols()) { - log(DEBUG, "Got result with %d rows and %d columns", res->Rows(), res->Cols()); + ServerInstance->Log(DEBUG, "Got result with %d rows and %d columns", res->Rows(), res->Cols()); for (int r = 0; r < res->Rows(); r++) { - log(DEBUG, "Row %d:", r); + ServerInstance->Log(DEBUG, "Row %d:", r); for(int i = 0; i < res->Cols(); i++) { - log(DEBUG, "\t[%s]: %s", res->ColName(i).c_str(), res->GetValue(r, i).d.c_str()); + ServerInstance->Log(DEBUG, "\t[%s]: %s", res->ColName(i).c_str(), res->GetValue(r, i).d.c_str()); } } } else { - log(DEBUG, "%d rows affected in query", res->Rows()); + ServerInstance->Log(DEBUG, "%d rows affected in query", res->Rows()); } } else { - log(DEBUG, "SQLrequest failed: %s", res->error.Str()); + ServerInstance->Log(DEBUG, "SQLrequest failed: %s", res->error.Str()); } return SQLSUCCESS; } - log(DEBUG, "Got unsupported API version string: %s", request->GetId()); + ServerInstance->Log(DEBUG, "Got unsupported API version string: %s", request->GetId()); return NULL; } diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index 50fac3041..cf46b2af9 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -236,7 +236,7 @@ class ModuleCBan : public Module { if (iter->set_on + iter->length <= ServerInstance->Time()) { - log(DEBUG, "m_cban.so: Ban on %s expired, removing...", iter->chname.c_str()); + ServerInstance->Log(DEBUG, "m_cban.so: Ban on %s expired, removing...", iter->chname.c_str()); ServerInstance->WriteOpers("*** %li second CBAN on %s (%s) set %u seconds ago expired", iter->length, iter->chname.c_str(), iter->reason.c_str(), ServerInstance->Time() - iter->set_on); cbans.erase(iter); go_again = true; diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index d89c2c3e3..32ac5726f 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -135,7 +135,7 @@ public: } else { - log(DEBUG, "m_cgiirc.so: Invalid <cgihost:mask> value in config: %s", hostmask.c_str()); + ServerInstance->Log(DEBUG, "m_cgiirc.so: Invalid <cgihost:mask> value in config: %s", hostmask.c_str()); continue; } } @@ -197,16 +197,16 @@ public: virtual void OnUserRegister(userrec* user) { - log(DEBUG, "m_cgiirc.so: User %s registering, %s %s", user->nick,user->host,user->GetIPString()); + ServerInstance->Log(DEBUG, "m_cgiirc.so: User %s registering, %s %s", user->nick,user->host,user->GetIPString()); for(CGIHostlist::iterator iter = Hosts.begin(); iter != Hosts.end(); iter++) { - log(DEBUG, "m_cgiirc.so: Matching %s against (%s or %s)", iter->hostmask.c_str(), user->host, user->GetIPString()); + ServerInstance->Log(DEBUG, "m_cgiirc.so: Matching %s against (%s or %s)", iter->hostmask.c_str(), user->host, user->GetIPString()); if(ServerInstance->MatchText(user->host, iter->hostmask) || ServerInstance->MatchText(user->GetIPString(), iter->hostmask)) { // Deal with it... - log(DEBUG, "m_cgiirc.so: Handling CGI:IRC user: %s (%s) matched %s", user->GetFullRealHost(), user->GetIPString(), iter->hostmask.c_str()); + ServerInstance->Log(DEBUG, "m_cgiirc.so: Handling CGI:IRC user: %s (%s) matched %s", user->GetFullRealHost(), user->GetIPString(), iter->hostmask.c_str()); if(iter->type == PASS) { @@ -234,7 +234,7 @@ public: bool CheckPass(userrec* user) { - log(DEBUG, "m_cgiirc.so: CheckPass(%s) - %s", user->nick, user->password); + ServerInstance->Log(DEBUG, "m_cgiirc.so: CheckPass(%s) - %s", user->nick, user->password); if(IsValidHost(user->password)) { @@ -250,7 +250,7 @@ public: #endif { /* We were given a IP in the password, we don't do DNS so they get this is as their host as well. */ - log(DEBUG, "m_cgiirc.so: Got an IP in the user's password"); + ServerInstance->Log(DEBUG, "m_cgiirc.so: Got an IP in the user's password"); if(NotifyOpers) ServerInstance->WriteOpers("*** Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from PASS", user->nick, user->host, user->password); @@ -258,7 +258,7 @@ public: else { /* We got as resolved hostname in the password. */ - log(DEBUG, "m_cgiirc.so: Got a hostname in the user's password"); + ServerInstance->Log(DEBUG, "m_cgiirc.so: Got a hostname in the user's password"); try { @@ -281,7 +281,7 @@ public: } else { - log(DEBUG, "m_cgiirc.so: User's password was not a valid host"); + ServerInstance->Log(DEBUG, "m_cgiirc.so: User's password was not a valid host"); } return false; @@ -317,7 +317,7 @@ public: try { - log(DEBUG,"MAKE RESOLVER: %s %d %s",newip, user->fd, "IDENT"); + ServerInstance->Log(DEBUG,"MAKE RESOLVER: %s %d %s",newip, user->fd, "IDENT"); CGIResolver* r = new CGIResolver(NotifyOpers, newip, false, user, user->fd, "IDENT"); ServerInstance->AddResolver(r); } diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index c88b99cdc..6310e6607 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -63,12 +63,12 @@ class ChanFounder : public ModeHandler { userrec* theuser = ServerInstance->FindNick(parameter); - log(DEBUG,"ChanFounder::OnModeChange"); + ServerInstance->Log(DEBUG,"ChanFounder::OnModeChange"); // cant find the user given as the parameter, eat the mode change. if (!theuser) { - log(DEBUG,"No such user in ChanFounder"); + ServerInstance->Log(DEBUG,"No such user in ChanFounder"); parameter = ""; return MODEACTION_DENY; } @@ -76,7 +76,7 @@ class ChanFounder : public ModeHandler // given user isnt even on the channel, eat the mode change if (!channel->HasUser(theuser)) { - log(DEBUG,"Channel doesn't have user in ChanFounder"); + ServerInstance->Log(DEBUG,"Channel doesn't have user in ChanFounder"); parameter = ""; return MODEACTION_DENY; } @@ -87,20 +87,20 @@ class ChanFounder : public ModeHandler // source is a server, or ulined, we'll let them +-q the user. if ((is_uline(source->nick)) || (is_uline(source->server)) || (!*source->server) || (!IS_LOCAL(source))) { - log(DEBUG,"Allowing remote mode change in ChanFounder"); + ServerInstance->Log(DEBUG,"Allowing remote mode change in ChanFounder"); if (adding) { if (!theuser->GetExt(founder,dummyptr)) { - log(DEBUG,"Does not have the ext item in ChanFounder"); + ServerInstance->Log(DEBUG,"Does not have the ext item in ChanFounder"); if (!theuser->Extend(founder,fakevalue)) - log(DEBUG,"COULD NOT EXTEND!!!"); + ServerInstance->Log(DEBUG,"COULD NOT EXTEND!!!"); // Tidy the nickname (make case match etc) parameter = theuser->nick; if (theuser->GetExt(founder, dummyptr)) - log(DEBUG,"Extended!"); + ServerInstance->Log(DEBUG,"Extended!"); else - log(DEBUG,"Not extended :("); + ServerInstance->Log(DEBUG,"Not extended :("); return MODEACTION_ALLOW; } } @@ -321,7 +321,7 @@ class ModuleChanProtect : public Module user->WriteServ("MODE %s +q %s",channel->name,user->nick); if (user->Extend("cm_founder_"+std::string(channel->name),fakevalue)) { - log(DEBUG,"Marked user "+std::string(user->nick)+" as founder for "+std::string(channel->name)); + ServerInstance->Log(DEBUG,"Marked user "+std::string(user->nick)+" as founder for "+std::string(channel->name)); } } } @@ -333,7 +333,7 @@ class ModuleChanProtect : public Module // etc of protected users. There are many types of access check, we're going to handle // a relatively small number of them relevent to our module using a switch statement. - log(DEBUG,"chanprotect OnAccessCheck %d",access_type); + ServerInstance->Log(DEBUG,"chanprotect OnAccessCheck %d",access_type); // don't allow action if: // (A) Theyre founder (no matter what) // (B) Theyre protected, and you're not @@ -355,16 +355,16 @@ class ModuleChanProtect : public Module { // a user has been deopped. Do we let them? hmmm... case AC_DEOP: - log(DEBUG,"OnAccessCheck AC_DEOP"); + ServerInstance->Log(DEBUG,"OnAccessCheck AC_DEOP"); if (dest->GetExt(founder,dummyptr)) { - log(DEBUG,"Has %s",founder.c_str()); + ServerInstance->Log(DEBUG,"Has %s",founder.c_str()); source->WriteServ("484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't deop "+std::string(dest->nick)+" as they're a channel founder"); return ACR_DENY; } else { - log(DEBUG,"Doesnt have %s",founder.c_str()); + ServerInstance->Log(DEBUG,"Doesnt have %s",founder.c_str()); } if ((dest->GetExt(protect,dummyptr)) && (!source->GetExt(protect,dummyptr))) { @@ -375,7 +375,7 @@ class ModuleChanProtect : public Module // a user is being kicked. do we chop off the end of the army boot? case AC_KICK: - log(DEBUG,"OnAccessCheck AC_KICK"); + ServerInstance->Log(DEBUG,"OnAccessCheck AC_KICK"); if (dest->GetExt(founder,dummyptr)) { source->WriteServ("484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't kick "+std::string(dest->nick)+" as they're a channel founder"); diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index fcda8881a..ef3a30fb2 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -348,7 +348,7 @@ class CloakUser : public ModeHandler // else, they have an ip b = std::string(ra) + "." + prefix + ".cloak"; } - log(DEBUG,"cloak: allocated "+b); + ServerInstance->Log(DEBUG,"cloak: allocated "+b); dest->ChangeDisplayedHost(b.c_str()); } diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index 526316362..a1511c3f2 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -110,7 +110,7 @@ class ModuleFilter : public Module ServerInstance->WriteOpers(std::string("FILTER: ")+user->nick+" had their notice filtered, target was "+target+": "+f->reason); user->WriteServ("NOTICE "+std::string(user->nick)+" :Your notice has been filtered and opers notified: "+f->reason); } - log(DEFAULT,"FILTER: "+std::string(user->nick)+std::string(" had their notice filtered, target was ")+target+": "+f->reason+" Action: "+f->action); + ServerInstance->Log(DEFAULT,"FILTER: "+std::string(user->nick)+std::string(" had their notice filtered, target was ")+target+": "+f->reason+" Action: "+f->action); if (f->action == "kill") { @@ -153,7 +153,7 @@ class ModuleFilter : public Module x->action = do_action; filters[pattern] = x; } - log(DEFAULT,"m_filter: read configuration from "+filterfile); + ServerInstance->Log(DEFAULT,"m_filter: read configuration from "+filterfile); DELETE(Conf); DELETE(MyConf); } diff --git a/src/modules/m_foobar.cpp b/src/modules/m_foobar.cpp index b6b6eae10..a5b0553b0 100644 --- a/src/modules/m_foobar.cpp +++ b/src/modules/m_foobar.cpp @@ -68,7 +68,7 @@ class ModuleFoobar : public Module // method called when a user connects std::string b = user->nick; - log(DEBUG,"Foobar: User connecting: "+b); + ServerInstance->Log(DEBUG,"Foobar: User connecting: "+b); } virtual void OnUserQuit(userrec* user, const std::string &reason) @@ -76,7 +76,7 @@ class ModuleFoobar : public Module // method called when a user disconnects std::string b = user->nick; - log(DEBUG,"Foobar: User quitting: "+b); + ServerInstance->Log(DEBUG,"Foobar: User quitting: "+b); } virtual void OnUserJoin(userrec* user, chanrec* channel) @@ -85,7 +85,7 @@ class ModuleFoobar : public Module std::string c = channel->name; std::string b = user->nick; - log(DEBUG,"Foobar: User "+b+" joined "+c); + ServerInstance->Log(DEBUG,"Foobar: User "+b+" joined "+c); } virtual void OnUserPart(userrec* user, chanrec* channel, const std::string &partreason) @@ -94,7 +94,7 @@ class ModuleFoobar : public Module std::string c = channel->name; std::string b = user->nick; - log(DEBUG,"Foobar: User "+b+" parted "+c); + ServerInstance->Log(DEBUG,"Foobar: User "+b+" parted "+c); } }; diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index 761ea2d9c..19367e1fe 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -51,7 +51,7 @@ class HttpSocket : public InspSocket HttpSocket(InspIRCd* SI, std::string host, int port, bool listening, unsigned long maxtime, FileReader* index_page) : InspSocket(SI, host, port, listening, maxtime), index(index_page) { - ilog(SI,DEBUG,"HttpSocket constructor"); + SI->Log(DEBUG,"HttpSocket constructor"); InternalState = HTTP_LISTEN; } @@ -225,7 +225,7 @@ class HttpSocket : public InspSocket if (!claimed) { SendHeaders(0, 404, ""); - ilog(Instance,DEBUG,"Page not claimed, 404"); + Instance->Log(DEBUG,"Page not claimed, 404"); } } } @@ -245,7 +245,7 @@ class HttpSocket : public InspSocket void Page(std::stringstream* n, int response, std::string& extraheaders) { - ilog(Instance,DEBUG,"Sending page"); + Instance->Log(DEBUG,"Sending page"); SendHeaders(n->str().length(), response, extraheaders); this->Write(n->str()); } @@ -302,7 +302,7 @@ class ModuleHttp : public Module char* OnRequest(Request* request) { - log(DEBUG,"Got HTTPDocument object"); + ServerInstance->Log(DEBUG,"Got HTTPDocument object"); claimed = true; HTTPDocument* doc = (HTTPDocument*)request->GetData(); HttpSocket* sock = (HttpSocket*)doc->sock; diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index 7e7c106a1..677beed22 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -173,7 +173,7 @@ class ModuleHttpStats : public Module Request req((char*)&response, (Module*)this, event->GetSource()); req.Send(); - log(DEBUG,"Sent"); + ServerInstance->Log(DEBUG,"Sent"); } } } diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index d88778242..4ee49d4ec 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -89,7 +89,7 @@ class RFC1413 : public InspSocket if (this->Instance->IsIdent(section)) { strlcpy(u->ident,section,IDENTMAX); - ilog(Instance,DEBUG,"IDENT SET: "+std::string(u->ident)); + Instance->Log(DEBUG,"IDENT SET: "+std::string(u->ident)); u->WriteServ("NOTICE "+std::string(u->nick)+" :*** Found your ident: "+std::string(u->ident)); } } @@ -147,7 +147,7 @@ class RFC1413 : public InspSocket themlen = sizeof(sock_them); if ((getsockname(this->u->fd,(sockaddr*)&sock_us,&uslen) || getpeername(this->u->fd, (sockaddr*)&sock_them, &themlen))) { - ilog(Instance,DEBUG,"Ident: failed to get socket names, bailing"); + Instance->Log(DEBUG,"Ident: failed to get socket names, bailing"); return false; } else @@ -159,7 +159,7 @@ class RFC1413 : public InspSocket snprintf(ident_request,127,"%d,%d\r\n",ntohs(sock_them.sin_port),ntohs(sock_us.sin_port)); #endif this->Write(ident_request); - ilog(Instance,DEBUG,"Sent ident request, waiting for reply"); + Instance->Log(DEBUG,"Sent ident request, waiting for reply"); return true; } } diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp index 9ad952f11..12b09ea30 100644 --- a/src/modules/m_kicknorejoin.cpp +++ b/src/modules/m_kicknorejoin.cpp @@ -90,18 +90,18 @@ public: delaylist* dl; if (chan->GetExt("norejoinusers", dl)) { - log(DEBUG, "m_kicknorejoin.so: got delay list, iterating over it"); + ServerInstance->Log(DEBUG, "m_kicknorejoin.so: got delay list, iterating over it"); std::vector<userrec*> itemstoremove; for (delaylist::iterator iter = dl->begin(); iter != dl->end(); iter++) { - log(DEBUG, "m_kicknorejoin.so:\t[%s] => %d", iter->first->nick, iter->second); + ServerInstance->Log(DEBUG, "m_kicknorejoin.so:\t[%s] => %d", iter->first->nick, iter->second); if (iter->second > time(NULL)) { - log(DEBUG, "m_kicknorejoin.so: still inside time slot"); + ServerInstance->Log(DEBUG, "m_kicknorejoin.so: still inside time slot"); if (iter->first == user) { - log(DEBUG, "m_kicknorejoin.so: and we have the right user"); + ServerInstance->Log(DEBUG, "m_kicknorejoin.so: and we have the right user"); user->WriteServ( "495 %s %s :You cannot rejoin this channel yet after being kicked (+J)", user->nick, chan->name); return 1; } @@ -109,7 +109,7 @@ public: else { // Expired record, remove. - log(DEBUG, "m_kicknorejoin.so: record expired"); + ServerInstance->Log(DEBUG, "m_kicknorejoin.so: record expired"); itemstoremove.push_back(iter->first); } } @@ -139,7 +139,7 @@ public: chan->Extend("norejoinusers", dl); } - log(DEBUG, "m_kicknorejoin.so: setting record for %s, %d second delay", user->nick, strtoint(chan->GetModeParameter('J'))); + ServerInstance->Log(DEBUG, "m_kicknorejoin.so: setting record for %s, %d second delay", user->nick, strtoint(chan->GetModeParameter('J'))); (*dl)[user] = time(NULL) + strtoint(chan->GetModeParameter('J')); } } diff --git a/src/modules/m_operlog.cpp b/src/modules/m_operlog.cpp index 54c864a1c..088410baa 100644 --- a/src/modules/m_operlog.cpp +++ b/src/modules/m_operlog.cpp @@ -62,7 +62,7 @@ class ModuleOperLog : public Module { plist.append(std::string(" ")+std::string(parameters[j])); } - log(DEFAULT,"OPERLOG: [%s!%s@%s] %s%s",user->nick,user->ident,user->host,command.c_str(),plist.c_str()); + ServerInstance->Log(DEFAULT,"OPERLOG: [%s!%s@%s] %s%s",user->nick,user->ident,user->host,command.c_str(),plist.c_str()); } return 0; diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index e4b149df2..492cd5bd0 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -111,44 +111,44 @@ class RemoveBase if (is_uline(user->server) || is_uline(user->nick)) { - log(DEBUG, "Setting ulevel to U"); + ServerInstance->Log(DEBUG, "Setting ulevel to U"); ulevel = chartolevel("U"); } if (user->GetExt(founderkey)) { - log(DEBUG, "Setting ulevel to ~"); + ServerInstance->Log(DEBUG, "Setting ulevel to ~"); ulevel = chartolevel("~"); } else if (user->GetExt(protectkey)) { - log(DEBUG, "Setting ulevel to &"); + ServerInstance->Log(DEBUG, "Setting ulevel to &"); ulevel = chartolevel("&"); } else { - log(DEBUG, "Setting ulevel to %s", channel->GetStatusChar(user)); + ServerInstance->Log(DEBUG, "Setting ulevel to %s", channel->GetStatusChar(user)); ulevel = chartolevel(channel->GetStatusChar(user)); } /* Now it's the same idea, except for the target. If they're ulined make sure they get a higher level than the sender can */ if (is_uline(target->server) || is_uline(target->nick)) { - log(DEBUG, "Setting tlevel to U"); + ServerInstance->Log(DEBUG, "Setting tlevel to U"); tlevel = chartolevel("U"); } else if (target->GetExt(founderkey)) { - log(DEBUG, "Setting tlevel to ~"); + ServerInstance->Log(DEBUG, "Setting tlevel to ~"); tlevel = chartolevel("~"); } else if (target->GetExt(protectkey)) { - log(DEBUG, "Setting tlevel to &"); + ServerInstance->Log(DEBUG, "Setting tlevel to &"); tlevel = chartolevel("&"); } else { - log(DEBUG, "Setting tlevel to %s", channel->GetStatusChar(target)); + ServerInstance->Log(DEBUG, "Setting tlevel to %s", channel->GetStatusChar(target)); tlevel = chartolevel(channel->GetStatusChar(target)); } diff --git a/src/modules/m_safelist.cpp b/src/modules/m_safelist.cpp index c7faf7fad..89e72f652 100644 --- a/src/modules/m_safelist.cpp +++ b/src/modules/m_safelist.cpp @@ -87,13 +87,13 @@ class ListTimer : public InspTimer break; } - log(DEBUG, "m_safelist.so: resuming spool of list to client %s at channel %ld", u->nick, ld->list_position); + ServerInstance->Log(DEBUG, "m_safelist.so: resuming spool of list to client %s at channel %ld", u->nick, ld->list_position); chan = NULL; /* Attempt to fill up to half the user's sendq with /LIST output */ long amount_sent = 0; do { - log(DEBUG,"Channel %ld",ld->list_position); + ServerInstance->Log(DEBUG,"Channel %ld",ld->list_position); if (!ld->list_position) u->WriteServ("321 %s Channel :Users Name",u->nick); chan = ServerInstance->GetChannelIndex(ld->list_position); @@ -107,7 +107,7 @@ class ListTimer : public InspTimer int counter = snprintf(buffer,MAXBUF,"322 %s %s %ld :[+%s] %s",u->nick,chan->name,users,chan->ChanModes(has_user),chan->topic); /* Increment total plus linefeed */ amount_sent += counter + 4 + strlen(ServerInstance->Config->ServerName); - log(DEBUG,"m_safelist.so: Sent %ld of safe %ld / 4",amount_sent,u->sendqmax); + ServerInstance->Log(DEBUG,"m_safelist.so: Sent %ld of safe %ld / 4",amount_sent,u->sendqmax); u->WriteServ(std::string(buffer)); } } diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index f034d5b43..77d9a756d 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -55,12 +55,12 @@ class cmd_samode : public command_t * Handles an SAMODE request. Notifies all +s users. */ std::string result; - log(DEBUG,"SAMODE: Being handled"); + ServerInstance->Log(DEBUG,"SAMODE: Being handled"); userrec* n = new userrec(ServerInstance); n->fd = FD_MAGIC_NUMBER; ServerInstance->SendMode(parameters,pcnt,n); delete n; - log(DEBUG,"SAMODE: Modechange handled"); + ServerInstance->Log(DEBUG,"SAMODE: Modechange handled"); result = std::string(user->nick); result.append(" used SAMODE"); for (int n = 0; n < pcnt; n++) diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp index 924f8dc09..4500ecbfc 100644 --- a/src/modules/m_services.cpp +++ b/src/modules/m_services.cpp @@ -43,13 +43,13 @@ class Channel_r : public ModeHandler // only a u-lined server may add or remove the +r mode. if ((is_uline(source->nick)) || (is_uline(source->server)) || (!*source->server || (strchr(source->nick,'.')))) { - log(DEBUG,"Allowing cmode +r, server and nick are: '%s','%s'",source->nick,source->server); + ServerInstance->Log(DEBUG,"Allowing cmode +r, server and nick are: '%s','%s'",source->nick,source->server); channel->SetMode('r',adding); return MODEACTION_ALLOW; } else { - log(DEBUG,"Only a server can set chanmode +r, server and nick are: '%s','%s'",source->nick,source->server); + ServerInstance->Log(DEBUG,"Only a server can set chanmode +r, server and nick are: '%s','%s'",source->nick,source->server); source->WriteServ("500 "+std::string(source->nick)+" :Only a server may modify the +r channel mode"); return MODEACTION_DENY; } @@ -66,13 +66,13 @@ class User_r : public ModeHandler { if ((kludgeme) || (is_uline(source->nick)) || (is_uline(source->server)) || (!*source->server || (strchr(source->nick,'.')))) { - log(DEBUG,"Allowing umode +r, server and nick are: '%s','%s'",source->nick,source->server); + ServerInstance->Log(DEBUG,"Allowing umode +r, server and nick are: '%s','%s'",source->nick,source->server); dest->SetMode('r',adding); return MODEACTION_ALLOW; } else { - log(DEBUG,"Only a server can set umode +r, server and nick are: '%s','%s'",source->nick, source->server); + ServerInstance->Log(DEBUG,"Only a server can set umode +r, server and nick are: '%s','%s'",source->nick, source->server); source->WriteServ("500 "+std::string(source->nick)+" :Only a server may modify the +r user mode"); return MODEACTION_DENY; } diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index ab0d62761..bbebda851 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -310,7 +310,7 @@ class TreeServer : public classbase int QuitUsers(const std::string &reason) { - log(DEBUG,"Removing all users from server %s",this->ServerName.c_str()); + ServerInstance->Log(DEBUG,"Removing all users from server %s",this->ServerName.c_str()); const char* reason_s = reason.c_str(); std::vector<userrec*> time_to_die; for (user_hash::iterator n = ServerInstance->clientlist.begin(); n != ServerInstance->clientlist.end(); n++) @@ -323,7 +323,7 @@ class TreeServer : public classbase for (std::vector<userrec*>::iterator n = time_to_die.begin(); n != time_to_die.end(); n++) { userrec* a = (userrec*)*n; - log(DEBUG,"Kill %s fd=%d",a->nick,a->fd); + ServerInstance->Log(DEBUG,"Kill %s fd=%d",a->nick,a->fd); if (!IS_LOCAL(a)) userrec::QuitUser(ServerInstance,a,reason_s); } @@ -705,13 +705,13 @@ class TreeSocket : public InspSocket ctx_in = new AES(); ctx_out = new AES(); - log(DEBUG,"Initialized AES key %s",key.c_str()); + ServerInstance->Log(DEBUG,"Initialized AES key %s",key.c_str()); // key must be 16, 24, 32 etc bytes (multiple of 8) keylength = key.length(); if (!(keylength == 16 || keylength == 24 || keylength == 32)) { this->Instance->WriteOpers("*** \2ERROR\2: Key length for encryptionkey is not 16, 24 or 32 bytes in length!"); - log(DEBUG,"Key length not 16, 24 or 32 characters!"); + ServerInstance->Log(DEBUG,"Key length not 16, 24 or 32 characters!"); } else { @@ -918,7 +918,7 @@ class TreeSocket : public InspSocket } else { - log(DEFAULT,"Squit from unknown server"); + ServerInstance->Log(DEFAULT,"Squit from unknown server"); } } @@ -993,7 +993,7 @@ class TreeSocket : public InspSocket */ if (TS == ourTS) { - log(DEBUG,"Entering TS equality check"); + ServerInstance->Log(DEBUG,"Entering TS equality check"); ModeHandler* mh = NULL; unsigned long paramptr = 3; std::string to_bounce = ""; @@ -1103,7 +1103,7 @@ class TreeSocket : public InspSocket if ((mh->GetNumParams(adding) > 0) && (paramptr < params.size())) { - log(DEBUG,"Mode removal %d %d",adding, mh->GetNumParams(adding)); + ServerInstance->Log(DEBUG,"Mode removal %d %d",adding, mh->GetNumParams(adding)); params_to_keep.push_back(params[paramptr++]); } } @@ -1151,19 +1151,19 @@ class TreeSocket : public InspSocket { for (q = 2; (q < params_to_keep.size()) && (q < 64); q++) { - log(DEBUG,"Item %d of %d", q, params_to_keep.size()); + ServerInstance->Log(DEBUG,"Item %d of %d", q, params_to_keep.size()); modelist[n++] = params_to_keep[q].c_str(); } } if (smode) { - log(DEBUG,"Send mode"); + ServerInstance->Log(DEBUG,"Send mode"); this->Instance->SendMode(modelist, n+2, who); } else { - log(DEBUG,"Send mode client"); + ServerInstance->Log(DEBUG,"Send mode client"); this->Instance->CallCommandHandler("MODE", modelist, n+2, who); } @@ -1278,11 +1278,11 @@ class TreeSocket : public InspSocket newparams[2] = modebounce; /* Only send it back the way it came, no need to send it anywhere else */ DoOneToOne(this->Instance->Config->ServerName,"FMODE",newparams,sourceserv); - log(DEBUG,"FMODE bounced intelligently, our TS less than theirs and the other server is NOT a uline."); + ServerInstance->Log(DEBUG,"FMODE bounced intelligently, our TS less than theirs and the other server is NOT a uline."); } else { - log(DEBUG,"Allow modes, TS lower for sender"); + ServerInstance->Log(DEBUG,"Allow modes, TS lower for sender"); /* The server was ulined, but something iffy is up with the TS. * Sound the alarm bells! */ @@ -1387,7 +1387,7 @@ class TreeSocket : public InspSocket ourTS = us->age; } - log(DEBUG,"FJOIN detected, our TS=%lu, their TS=%lu",ourTS,TS); + ServerInstance->Log(DEBUG,"FJOIN detected, our TS=%lu, their TS=%lu",ourTS,TS); /* do this first, so our mode reversals are correctly received by other servers * if there is a TS collision. @@ -1433,18 +1433,18 @@ class TreeSocket : public InspSocket if ((ourTS >= TS) || (this->Instance->IsUlined(who->server))) { /* We also always let u-lined clients win, no matter what the TS value */ - log(DEBUG,"Our our channel newer than theirs, accepting their modes"); + ServerInstance->Log(DEBUG,"Our our channel newer than theirs, accepting their modes"); this->Instance->SendMode((const char**)mode_users,modectr,who); if (ourTS != TS) { - log(DEFAULT,"Channel TS for %s changed from %lu to %lu",us->name,ourTS,TS); + ServerInstance->Log(DEFAULT,"Channel TS for %s changed from %lu to %lu",us->name,ourTS,TS); us->age = TS; ourTS = TS; } } else { - log(DEBUG,"Their channel newer than ours, bouncing their modes"); + ServerInstance->Log(DEBUG,"Their channel newer than ours, bouncing their modes"); /* bouncy bouncy! */ std::deque<std::string> params; /* modes are now being UNSET... */ @@ -1474,18 +1474,18 @@ class TreeSocket : public InspSocket { if (ourTS >= TS) { - log(DEBUG,"Our our channel newer than theirs, accepting their modes"); + ServerInstance->Log(DEBUG,"Our our channel newer than theirs, accepting their modes"); this->Instance->SendMode((const char**)mode_users,modectr,who); if (ourTS != TS) { - log(DEFAULT,"Channel TS for %s changed from %lu to %lu",us->name,ourTS,TS); + ServerInstance->Log(DEFAULT,"Channel TS for %s changed from %lu to %lu",us->name,ourTS,TS); us->age = TS; ourTS = TS; } } else { - log(DEBUG,"Their channel newer than ours, bouncing their modes"); + ServerInstance->Log(DEBUG,"Their channel newer than ours, bouncing their modes"); std::deque<std::string> params; *mode_users[1] = '-'; for (unsigned int x = 0; x < modectr; x++) @@ -1513,7 +1513,7 @@ class TreeSocket : public InspSocket time_t ourTS = c->age; if (ourTS >= theirTS) { - log(DEBUG,"Updating timestamp for %s, our timestamp was %lu and theirs is %lu",c->name,ourTS,theirTS); + ServerInstance->Log(DEBUG,"Updating timestamp for %s, our timestamp was %lu and theirs is %lu",c->name,ourTS,theirTS); c->age = theirTS; } } @@ -1542,14 +1542,14 @@ class TreeSocket : public InspSocket params[5] = params[5].substr(params[5].find_first_not_of('+')); const char* tempnick = params[1].c_str(); - log(DEBUG,"Introduce client %s!%s@%s",tempnick,params[4].c_str(),params[2].c_str()); + ServerInstance->Log(DEBUG,"Introduce client %s!%s@%s",tempnick,params[4].c_str(),params[2].c_str()); user_hash::iterator iter = this->Instance->clientlist.find(tempnick); if (iter != this->Instance->clientlist.end()) { // nick collision - log(DEBUG,"Nick collision on %s!%s@%s: %lu %lu",tempnick,params[4].c_str(),params[2].c_str(),(unsigned long)age,(unsigned long)iter->second->age); + ServerInstance->Log(DEBUG,"Nick collision on %s!%s@%s: %lu %lu",tempnick,params[4].c_str(),params[2].c_str(),(unsigned long)age,(unsigned long)iter->second->age); this->WriteLine(std::string(":")+this->Instance->Config->ServerName+" KILL "+tempnick+" :Nickname collision"); return true; } @@ -1583,7 +1583,7 @@ class TreeSocket : public InspSocket TreeServer* SourceServer = FindServer(source); if (SourceServer) { - log(DEBUG,"Found source server of %s",_new->nick); + ServerInstance->Log(DEBUG,"Found source server of %s",_new->nick); SourceServer->AddUserCount(); } @@ -1596,7 +1596,7 @@ class TreeSocket : public InspSocket */ void SendFJoins(TreeServer* Current, chanrec* c) { - log(DEBUG,"Sending FJOINs to other server for %s",c->name); + ServerInstance->Log(DEBUG,"Sending FJOINs to other server for %s",c->name); char list[MAXBUF]; std::string individual_halfops = std::string(":")+this->Instance->Config->ServerName+" FMODE "+c->name+" "+ConvToStr(c->age); @@ -1853,14 +1853,14 @@ class TreeSocket : public InspSocket char result[1024]; memset(result,0,1024); memset(out,0,1024); - log(DEBUG,"Original string '%s'",ret.c_str()); + ServerInstance->Log(DEBUG,"Original string '%s'",ret.c_str()); /* ERROR + CAPAB is still allowed unencryped */ if ((ret.substr(0,7) != "ERROR :") && (ret.substr(0,6) != "CAPAB ")) { int nbytes = from64tobits(out, ret.c_str(), 1024); if ((nbytes > 0) && (nbytes < 1024)) { - log(DEBUG,"m_spanningtree: decrypt %d bytes",nbytes); + ServerInstance->Log(DEBUG,"m_spanningtree: decrypt %d bytes",nbytes); ctx_in->Decrypt(out, result, nbytes, 0); for (int t = 0; t < nbytes; t++) if (result[t] == '\7') result[t] = 0; @@ -1870,7 +1870,7 @@ class TreeSocket : public InspSocket } if (!this->ProcessLine(ret)) { - log(DEBUG,"ProcessLine says no!"); + ServerInstance->Log(DEBUG,"ProcessLine says no!"); return false; } } @@ -1884,7 +1884,7 @@ class TreeSocket : public InspSocket int WriteLine(std::string line) { - log(DEBUG,"OUT: %s",line.c_str()); + ServerInstance->Log(DEBUG,"OUT: %s",line.c_str()); if (this->ctx_out) { char result[10240]; @@ -1895,7 +1895,7 @@ class TreeSocket : public InspSocket int n = this->keylength - (line.length() % this->keylength); if (n) { - log(DEBUG,"Append %d chars to line to make it %d long from %d, key length %d",n,n+line.length(),line.length(),this->keylength); + ServerInstance->Log(DEBUG,"Append %d chars to line to make it %d long from %d, key length %d",n,n+line.length(),line.length(),this->keylength); line.append(n,'\7'); } } @@ -1962,7 +1962,7 @@ class TreeSocket : public InspSocket { if (params.size() != 1) { - log(DEBUG,"Received invalid oper type from %s",prefix.c_str()); + ServerInstance->Log(DEBUG,"Received invalid oper type from %s",prefix.c_str()); return true; } std::string opertype = params[0]; @@ -2228,7 +2228,7 @@ class TreeSocket : public InspSocket } if (!this->bursting) { - log(DEBUG,"Applying lines..."); + ServerInstance->Log(DEBUG,"Applying lines..."); ServerInstance->XLines->apply_lines(APPLY_ZLINES|APPLY_GLINES|APPLY_QLINES); } return true; @@ -2255,12 +2255,12 @@ class TreeSocket : public InspSocket if (params.size() < 1) return true; - log(DEBUG,"In IDLE command"); + ServerInstance->Log(DEBUG,"In IDLE command"); userrec* u = this->Instance->FindNick(prefix); if (u) { - log(DEBUG,"USER EXISTS: %s",u->nick); + ServerInstance->Log(DEBUG,"USER EXISTS: %s",u->nick); // an incoming request if (params.size() == 1) { @@ -2268,10 +2268,10 @@ class TreeSocket : public InspSocket if ((x) && (IS_LOCAL(x))) { userrec* x = this->Instance->FindNick(params[0]); - log(DEBUG,"Got IDLE"); + ServerInstance->Log(DEBUG,"Got IDLE"); char signon[MAXBUF]; char idle[MAXBUF]; - log(DEBUG,"Sending back IDLE 3"); + ServerInstance->Log(DEBUG,"Sending back IDLE 3"); snprintf(signon,MAXBUF,"%lu",(unsigned long)x->signon); snprintf(idle,MAXBUF,"%lu",(unsigned long)abs((x->idle_lastmsg)-time(NULL))); std::deque<std::string> par; @@ -2293,7 +2293,7 @@ class TreeSocket : public InspSocket userrec* who_to_send_to = this->Instance->FindNick(who_did_the_whois); if ((who_to_send_to) && (IS_LOCAL(who_to_send_to))) { - log(DEBUG,"Got final IDLE"); + ServerInstance->Log(DEBUG,"Got final IDLE"); // an incoming reply to a whois we sent out std::string nick_whoised = prefix; unsigned long signon = atoi(params[1].c_str()); @@ -2570,7 +2570,7 @@ class TreeSocket : public InspSocket line = line.substr(0, line.find_first_of("\r\n")); - log(DEBUG,"IN: %s", line.c_str()); + ServerInstance->Log(DEBUG,"IN: %s", line.c_str()); this->Split(line.c_str(),params); @@ -2733,7 +2733,7 @@ class TreeSocket : public InspSocket if ((!route_back_again) || (route_back_again->GetSocket() != this)) { if (route_back_again) - log(DEBUG,"Protocol violation: Fake direction in command '%s' from connection '%s'",line.c_str(),this->GetName().c_str()); + ServerInstance->Log(DEBUG,"Protocol violation: Fake direction in command '%s' from connection '%s'",line.c_str(),this->GetName().c_str()); return true; } @@ -2982,7 +2982,7 @@ class TreeSocket : public InspSocket } else { - log(DEBUG,"Command with unknown origin '%s'",prefix.c_str()); + ServerInstance->Log(DEBUG,"Command with unknown origin '%s'",prefix.c_str()); return true; } } @@ -3121,13 +3121,13 @@ class SecurityIPResolver : public Resolver void OnLookupComplete(const std::string &result) { - log(DEBUG,"Security IP cache: Adding IP address '%s' for Link '%s'",result.c_str(),MyLink.Name.c_str()); + ServerInstance->Log(DEBUG,"Security IP cache: Adding IP address '%s' for Link '%s'",result.c_str(),MyLink.Name.c_str()); ValidIPs.push_back(result); } void OnError(ResolverError e, const std::string &errormessage) { - log(DEBUG,"Could not resolve IP associated with Link '%s': %s",MyLink.Name.c_str(),errormessage.c_str()); + ServerInstance->Log(DEBUG,"Could not resolve IP associated with Link '%s': %s",MyLink.Name.c_str(),errormessage.c_str()); } }; @@ -3194,20 +3194,20 @@ bool DoOneToAllButSenderRaw(std::string data, std::string omit, std::string pref } else { - log(DEBUG,"Channel privmsg going to chan %s",params[0].c_str()); + ServerInstance->Log(DEBUG,"Channel privmsg going to chan %s",params[0].c_str()); chanrec* c = ServerInstance->FindChan(params[0]); if (c) { std::deque<TreeServer*> list; GetListOfServersForChannel(c,list); - log(DEBUG,"Got a list of %d servers",list.size()); + ServerInstance->Log(DEBUG,"Got a list of %d servers",list.size()); unsigned int lsize = list.size(); for (unsigned int i = 0; i < lsize; i++) { TreeSocket* Sock = list[i]->GetSocket(); if ((Sock) && (list[i]->GetName() != omit) && (omitroute != list[i])) { - log(DEBUG,"Writing privmsg to server %s",list[i]->GetName().c_str()); + ServerInstance->Log(DEBUG,"Writing privmsg to server %s",list[i]->GetName().c_str()); Sock->WriteLine(data); } } @@ -3326,7 +3326,7 @@ void ReadConfiguration(bool rebind) } else { - log(DEFAULT,"m_spanningtree: Warning: Failed to bind server port %d",Port); + ServerInstance->Log(DEFAULT,"m_spanningtree: Warning: Failed to bind server port %d",Port); listener->Close(); DELETE(listener); } @@ -3369,34 +3369,34 @@ void ReadConfiguration(bool rebind) } catch (ModuleException& e) { - log(DEBUG,"Error in resolver: %s",e.GetReason()); + ServerInstance->Log(DEBUG,"Error in resolver: %s",e.GetReason()); } } LinkBlocks.push_back(L); - log(DEBUG,"m_spanningtree: Read server %s with host %s:%d",L.Name.c_str(),L.IPAddr.c_str(),L.Port); + ServerInstance->Log(DEBUG,"m_spanningtree: Read server %s with host %s:%d",L.Name.c_str(),L.IPAddr.c_str(),L.Port); } else { if (L.IPAddr == "") { - log(DEFAULT,"Invalid configuration for server '%s', IP address not defined!",L.Name.c_str()); + ServerInstance->Log(DEFAULT,"Invalid configuration for server '%s', IP address not defined!",L.Name.c_str()); } else if (L.RecvPass == "") { - log(DEFAULT,"Invalid configuration for server '%s', recvpass not defined!",L.Name.c_str()); + ServerInstance->Log(DEFAULT,"Invalid configuration for server '%s', recvpass not defined!",L.Name.c_str()); } else if (L.SendPass == "") { - log(DEFAULT,"Invalid configuration for server '%s', sendpass not defined!",L.Name.c_str()); + ServerInstance->Log(DEFAULT,"Invalid configuration for server '%s', sendpass not defined!",L.Name.c_str()); } else if (L.Name == "") { - log(DEFAULT,"Invalid configuration, link tag without a name!"); + ServerInstance->Log(DEFAULT,"Invalid configuration, link tag without a name!"); } else if (!L.Port) { - log(DEFAULT,"Invalid configuration for server '%s', no port specified!",L.Name.c_str()); + ServerInstance->Log(DEFAULT,"Invalid configuration for server '%s', no port specified!",L.Name.c_str()); } } } @@ -3657,7 +3657,7 @@ class ModuleSpanningTree : public Module TreeSocket* sock = s->GetSocket(); if (sock) { - log(DEBUG,"Splitting server %s",s->GetName().c_str()); + ServerInstance->Log(DEBUG,"Splitting server %s",s->GetName().c_str()); ServerInstance->WriteOpers("*** SQUIT: Server \002%s\002 removed from network by %s",parameters[0],user->nick); sock->Squit(s,"Server quit by "+std::string(user->nick)+"!"+std::string(user->ident)+"@"+std::string(user->host)); ServerInstance->RemoveSocket(sock); @@ -3754,7 +3754,7 @@ class ModuleSpanningTree : public Module { if ((x->AutoConnect) && (curtime >= x->NextConnectTime)) { - log(DEBUG,"Auto-Connecting %s",x->Name.c_str()); + ServerInstance->Log(DEBUG,"Auto-Connecting %s",x->Name.c_str()); x->NextConnectTime = curtime + x->AutoConnect; TreeServer* CheckDupe = FindServer(x->Name.c_str()); if (!CheckDupe) @@ -3787,7 +3787,7 @@ class ModuleSpanningTree : public Module } catch (ModuleException& e) { - log(DEBUG,"Error in resolver: %s",e.GetReason()); + ServerInstance->Log(DEBUG,"Error in resolver: %s",e.GetReason()); } } @@ -3868,7 +3868,7 @@ class ModuleSpanningTree : public Module } catch (ModuleException& e) { - log(DEBUG,"Error in resolver: %s",e.GetReason()); + ServerInstance->Log(DEBUG,"Error in resolver: %s",e.GetReason()); } } return 1; @@ -3970,7 +3970,7 @@ class ModuleSpanningTree : public Module params.push_back(std::string(parameters[j])); } } - log(DEBUG,"Globally route '%s'",command.c_str()); + ServerInstance->Log(DEBUG,"Globally route '%s'",command.c_str()); DoOneToMany(user->nick,command,params); } return 0; diff --git a/src/modules/m_testcommand.cpp b/src/modules/m_testcommand.cpp index 9c5b1ab23..61effc3de 100644 --- a/src/modules/m_testcommand.cpp +++ b/src/modules/m_testcommand.cpp @@ -39,12 +39,12 @@ class MyV6Resolver : public Resolver virtual void OnLookupComplete(const std::string &result) { - log(DEBUG,"*** RESOLVER COMPLETED %s LOOKUP, IP IS: '%s'",fw ? "FORWARD" : "REVERSE", result.c_str()); + ServerInstance->Log(DEBUG,"*** RESOLVER COMPLETED %s LOOKUP, IP IS: '%s'",fw ? "FORWARD" : "REVERSE", result.c_str()); } virtual void OnError(ResolverError e, const std::string &errormessage) { - log(DEBUG,"*** RESOLVER GOT ERROR: %d: %s",e,errormessage.c_str()); + ServerInstance->Log(DEBUG,"*** RESOLVER GOT ERROR: %d: %s",e,errormessage.c_str()); } }; @@ -72,7 +72,7 @@ class cmd_woot : public command_t } catch (ModuleException& e) { - log(DEBUG,"Danger, will robinson! There was an exception: %s",e.GetReason()); + ServerInstance->Log(DEBUG,"Danger, will robinson! There was an exception: %s",e.GetReason()); } } }; diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index 50c656a34..521ddde56 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -179,7 +179,7 @@ class cmd_watch : public command_t w->watcher = user; w->target = nick; watches.push_back(w); - log(DEBUG,"*** Added %s to watchlist of %s",nick,user->nick); + ServerInstance->Log(DEBUG,"*** Added %s to watchlist of %s",nick,user->nick); } userrec* a = ServerInstance->FindNick(nick); if (a) @@ -217,7 +217,7 @@ class Modulewatch : public Module virtual void OnUserQuit(userrec* user, const std::string &reason) { - log(DEBUG,"*** WATCH: On global quit: user %s",user->nick); + ServerInstance->Log(DEBUG,"*** WATCH: On global quit: user %s",user->nick); irc::string n2 = user->nick; for (watchlist::iterator q = watches.begin(); q != watches.end(); q++) { @@ -225,7 +225,7 @@ class Modulewatch : public Module irc::string n1 = a->target.c_str(); if (n1 == n2) { - log(DEBUG,"*** WATCH: On global quit: user %s is in notify of %s",user->nick,a->watcher->nick); + ServerInstance->Log(DEBUG,"*** WATCH: On global quit: user %s is in notify of %s",user->nick,a->watcher->nick); a->watcher->WriteServ("601 %s %s %s %s %lu :went offline",a->watcher->nick,user->nick,user->ident,user->dhost,time(NULL)); } } @@ -250,14 +250,14 @@ class Modulewatch : public Module virtual void OnGlobalConnect(userrec* user) { irc::string n2 = user->nick; - log(DEBUG,"*** WATCH: On global connect: user %s",user->nick); + ServerInstance->Log(DEBUG,"*** WATCH: On global connect: user %s",user->nick); for (watchlist::iterator q = watches.begin(); q != watches.end(); q++) { watchentry* a = (watchentry*)(*q); irc::string n1 = a->target.c_str(); if (n1 == n2) { - log(DEBUG,"*** WATCH: On global connect: user %s is in notify of %s",user->nick,a->watcher->nick); + ServerInstance->Log(DEBUG,"*** WATCH: On global connect: user %s is in notify of %s",user->nick,a->watcher->nick); a->watcher->WriteServ("600 %s %s %s %s %lu :arrived online",a->watcher->nick,user->nick,user->ident,user->dhost,user->age); } } @@ -267,7 +267,7 @@ class Modulewatch : public Module { irc::string n2 = oldnick.c_str(); irc::string n3 = user->nick; - log(DEBUG,"*** WATCH: On global nickchange: old nick: %s new nick: %s",oldnick.c_str(),user->nick); + ServerInstance->Log(DEBUG,"*** WATCH: On global nickchange: old nick: %s new nick: %s",oldnick.c_str(),user->nick); for (watchlist::iterator q = watches.begin(); q != watches.end(); q++) { watchentry* a = (watchentry*)(*q); @@ -275,13 +275,13 @@ class Modulewatch : public Module // changed from a nick on the watchlist to one that isnt if (n1 == n2) { - log(DEBUG,"*** WATCH: On global nickchange: old nick %s was on notify list of %s",oldnick.c_str(),a->watcher->nick); + ServerInstance->Log(DEBUG,"*** WATCH: On global nickchange: old nick %s was on notify list of %s",oldnick.c_str(),a->watcher->nick); a->watcher->WriteServ("601 %s %s %s %s %lu :went offline",a->watcher->nick,oldnick.c_str(),user->ident,user->dhost,time(NULL)); } else if (n1 == n3) { // changed from a nick not on notify to one that is - log(DEBUG,"*** WATCH: On global nickchange: new nick %s is on notify list of %s",user->nick,a->watcher->nick); + ServerInstance->Log(DEBUG,"*** WATCH: On global nickchange: new nick %s is on notify list of %s",user->nick,a->watcher->nick); a->watcher->WriteServ("600 %s %s %s %s %lu :arrived online",a->watcher->nick,user->nick,user->ident,user->dhost,user->age); } } |