summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2013-04-12 07:58:58 -0700
committerAttila Molnar <attilamolnar@hush.com>2013-04-12 07:58:58 -0700
commita5fe50aca04ca554d313e7361c571c6a497a9c4e (patch)
tree88fdf155712654b0c783bb53770d8e80e28b0d10 /src/modules/m_spanningtree
parent1858feabd342636df0b52780c978979b4e049fc3 (diff)
parent645f7e18c64a6628ede880dc69bf8825ba93b375 (diff)
Merge pull request #488 from SaberUK/master+loglevel-rename
Add LOG_ prefix to the log level enum values.
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/compat.cpp4
-rw-r--r--src/modules/m_spanningtree/fjoin.cpp6
-rw-r--r--src/modules/m_spanningtree/fmode.cpp2
-rw-r--r--src/modules/m_spanningtree/hmac.cpp2
-rw-r--r--src/modules/m_spanningtree/main.cpp2
-rw-r--r--src/modules/m_spanningtree/override_map.cpp4
-rw-r--r--src/modules/m_spanningtree/postcommand.cpp4
-rw-r--r--src/modules/m_spanningtree/resolvers.cpp2
-rw-r--r--src/modules/m_spanningtree/server.cpp2
-rw-r--r--src/modules/m_spanningtree/treeserver.cpp4
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp4
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp12
-rw-r--r--src/modules/m_spanningtree/uid.cpp4
-rw-r--r--src/modules/m_spanningtree/utils.cpp8
14 files changed, 30 insertions, 30 deletions
diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp
index 92f2bc8f4..32bdb3df8 100644
--- a/src/modules/m_spanningtree/compat.cpp
+++ b/src/modules/m_spanningtree/compat.cpp
@@ -29,7 +29,7 @@ void TreeSocket::WriteLine(std::string line)
{
if (line[0] != ':')
{
- ServerInstance->Logs->Log("m_spanningtree", DEFAULT, "Sending line without server prefix!");
+ ServerInstance->Logs->Log("m_spanningtree", LOG_DEFAULT, "Sending line without server prefix!");
line = ":" + ServerInstance->Config->GetSID() + " " + line;
}
if (proto_version != ProtocolVersion)
@@ -42,7 +42,7 @@ void TreeSocket::WriteLine(std::string line)
}
}
- ServerInstance->Logs->Log("m_spanningtree", RAWIO, "S[%d] O %s", this->GetFd(), line.c_str());
+ ServerInstance->Logs->Log("m_spanningtree", LOG_RAWIO, "S[%d] O %s", this->GetFd(), line.c_str());
this->WriteData(line);
this->WriteData(newline);
}
diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp
index a90c62924..29ee9244c 100644
--- a/src/modules/m_spanningtree/fjoin.cpp
+++ b/src/modules/m_spanningtree/fjoin.cpp
@@ -70,7 +70,7 @@ CmdResult CommandFJoin::Handle(const std::vector<std::string>& params, User *src
if (!TS)
{
- ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"*** BUG? *** TS of 0 sent to FJOIN. Are some services authors smoking craq, or is it 1970 again?. Dropped.");
+ ServerInstance->Logs->Log("m_spanningtree",LOG_DEFAULT,"*** BUG? *** TS of 0 sent to FJOIN. Are some services authors smoking craq, or is it 1970 again?. Dropped.");
ServerInstance->SNO->WriteToSnoMask('d', "WARNING: The server %s is sending FJOIN with a TS of zero. Total craq. Command was dropped.", srcuser->server.c_str());
return CMD_INVALID;
}
@@ -152,7 +152,7 @@ CmdResult CommandFJoin::Handle(const std::vector<std::string>& params, User *src
ModeHandler *mh = ServerInstance->Modes->FindMode(*unparsedmodes, MODETYPE_CHANNEL);
if (!mh)
{
- ServerInstance->Logs->Log("m_spanningtree", SPARSE, "Unrecognised mode %c, dropping link", *unparsedmodes);
+ ServerInstance->Logs->Log("m_spanningtree", LOG_SPARSE, "Unrecognised mode %c, dropping link", *unparsedmodes);
return CMD_INVALID;
}
@@ -181,7 +181,7 @@ CmdResult CommandFJoin::Handle(const std::vector<std::string>& params, User *src
}
else
{
- ServerInstance->Logs->Log("m_spanningtree",SPARSE, "Ignored nonexistant user %s in fjoin to %s (probably quit?)", usr, channel.c_str());
+ ServerInstance->Logs->Log("m_spanningtree",LOG_SPARSE, "Ignored nonexistant user %s in fjoin to %s (probably quit?)", usr, channel.c_str());
continue;
}
}
diff --git a/src/modules/m_spanningtree/fmode.cpp b/src/modules/m_spanningtree/fmode.cpp
index c1e452db6..5dd77c360 100644
--- a/src/modules/m_spanningtree/fmode.cpp
+++ b/src/modules/m_spanningtree/fmode.cpp
@@ -72,7 +72,7 @@ CmdResult CommandFMode::Handle(const std::vector<std::string>& params, User *who
if (!TS)
{
- ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"*** BUG? *** TS of 0 sent to FMODE. Are some services authors smoking craq, or is it 1970 again?. Dropped.");
+ ServerInstance->Logs->Log("m_spanningtree",LOG_DEFAULT,"*** BUG? *** TS of 0 sent to FMODE. Are some services authors smoking craq, or is it 1970 again?. Dropped.");
ServerInstance->SNO->WriteToSnoMask('d', "WARNING: The server %s is sending FMODE with a TS of zero. Total craq. Mode was dropped.", sourceserv.c_str());
return CMD_INVALID;
}
diff --git a/src/modules/m_spanningtree/hmac.cpp b/src/modules/m_spanningtree/hmac.cpp
index 65b3a5997..8dc18cbbd 100644
--- a/src/modules/m_spanningtree/hmac.cpp
+++ b/src/modules/m_spanningtree/hmac.cpp
@@ -65,7 +65,7 @@ std::string TreeSocket::MakePass(const std::string &password, const std::string
return "AUTH:" + BinToBase64(sha256->hmac(password, challenge));
if (!challenge.empty() && !sha256)
- ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Not authenticating to server using SHA256/HMAC because we don't have m_sha256 loaded!");
+ ServerInstance->Logs->Log("m_spanningtree",LOG_DEFAULT,"Not authenticating to server using SHA256/HMAC because we don't have m_sha256 loaded!");
return password;
}
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index efd899c44..9aee4a4ce 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -758,7 +758,7 @@ void ModuleSpanningTree::OnPreRehash(User* user, const std::string &parameter)
if (loopCall)
return; // Don't generate a REHASH here if we're in the middle of processing a message that generated this one
- ServerInstance->Logs->Log("remoterehash", DEBUG, "called with param %s", parameter.c_str());
+ ServerInstance->Logs->Log("remoterehash", LOG_DEBUG, "called with param %s", parameter.c_str());
// Send out to other servers
if (!parameter.empty() && parameter[0] != '-')
diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp
index 69f088f65..5c69aef16 100644
--- a/src/modules/m_spanningtree/override_map.cpp
+++ b/src/modules/m_spanningtree/override_map.cpp
@@ -38,7 +38,7 @@ const std::string ModuleSpanningTree::MapOperInfo(TreeServer* Current)
void ModuleSpanningTree::ShowMap(TreeServer* Current, User* user, int depth, int &line, char* names, int &maxnamew, char* stats)
{
- ServerInstance->Logs->Log("map",DEBUG,"ShowMap depth %d on line %d", depth, line);
+ ServerInstance->Logs->Log("map",LOG_DEBUG,"ShowMap depth %d on line %d", depth, line);
float percent;
if (ServerInstance->Users->clientlist->size() == 0)
@@ -174,7 +174,7 @@ bool ModuleSpanningTree::HandleMap(const std::vector<std::string>& parameters, U
float avg_users = totusers * 1.0 / line;
- ServerInstance->Logs->Log("map",DEBUG,"local");
+ ServerInstance->Logs->Log("map",LOG_DEBUG,"local");
for (int t = 0; t < line; t++)
{
// terminate the string at maxnamew characters
diff --git a/src/modules/m_spanningtree/postcommand.cpp b/src/modules/m_spanningtree/postcommand.cpp
index 471bbfcb9..b91435eee 100644
--- a/src/modules/m_spanningtree/postcommand.cpp
+++ b/src/modules/m_spanningtree/postcommand.cpp
@@ -73,7 +73,7 @@ void SpanningTreeUtilities::RouteCommand(TreeServer* origin, const std::string &
TreeServer* sdest = FindServer(routing.serverdest);
if (!sdest)
{
- ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Trying to route ENCAP to nonexistant server %s",
+ ServerInstance->Logs->Log("m_spanningtree",LOG_DEFAULT,"Trying to route ENCAP to nonexistant server %s",
routing.serverdest.c_str());
return;
}
@@ -88,7 +88,7 @@ void SpanningTreeUtilities::RouteCommand(TreeServer* origin, const std::string &
if (!(ver.Flags & (VF_COMMON | VF_CORE)) && srcmodule != Creator)
{
- ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Routed command %s from non-VF_COMMON module %s",
+ ServerInstance->Logs->Log("m_spanningtree",LOG_DEFAULT,"Routed command %s from non-VF_COMMON module %s",
command.c_str(), srcmodule->ModuleSourceFile.c_str());
return;
}
diff --git a/src/modules/m_spanningtree/resolvers.cpp b/src/modules/m_spanningtree/resolvers.cpp
index d7c4c5227..671300111 100644
--- a/src/modules/m_spanningtree/resolvers.cpp
+++ b/src/modules/m_spanningtree/resolvers.cpp
@@ -107,6 +107,6 @@ void SecurityIPResolver::OnError(ResolverError e, const std::string &errormessag
ServerInstance->AddResolver(res, cached);
return;
}
- ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Could not resolve IP associated with Link '%s': %s",
+ ServerInstance->Logs->Log("m_spanningtree",LOG_DEFAULT,"Could not resolve IP associated with Link '%s': %s",
MyLink->Name.c_str(),errormessage.c_str());
}
diff --git a/src/modules/m_spanningtree/server.cpp b/src/modules/m_spanningtree/server.cpp
index e6cec5cb4..d266b31f4 100644
--- a/src/modules/m_spanningtree/server.cpp
+++ b/src/modules/m_spanningtree/server.cpp
@@ -237,7 +237,7 @@ bool TreeSocket::Inbound_Server(parameterlist &params)
}
/* Check for fully initialized instances of the server by id */
- ServerInstance->Logs->Log("m_spanningtree",DEBUG,"Looking for dupe SID %s", sid.c_str());
+ ServerInstance->Logs->Log("m_spanningtree",LOG_DEBUG,"Looking for dupe SID %s", sid.c_str());
CheckDupe = Utils->FindServerID(sid);
if (CheckDupe)
diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp
index 493b05ebf..6213483ee 100644
--- a/src/modules/m_spanningtree/treeserver.cpp
+++ b/src/modules/m_spanningtree/treeserver.cpp
@@ -70,7 +70,7 @@ TreeServer::TreeServer(SpanningTreeUtilities* Util, std::string Name, std::strin
long ts = ServerInstance->Time() * 1000 + (ServerInstance->Time_ns() / 1000000);
this->StartBurst = ts;
- ServerInstance->Logs->Log("m_spanningtree",DEBUG, "Started bursting at time %lu", ts);
+ ServerInstance->Logs->Log("m_spanningtree",LOG_DEBUG, "Started bursting at time %lu", ts);
/* find the 'route' for this server (e.g. the one directly connected
* to the local server, which we can use to reach it)
@@ -158,7 +158,7 @@ void TreeServer::FinishBurst()
void TreeServer::SetID(const std::string &id)
{
- ServerInstance->Logs->Log("m_spanningtree",DEBUG, "Setting SID to " + id);
+ ServerInstance->Logs->Log("m_spanningtree",LOG_DEBUG, "Setting SID to " + id);
sid = id;
Utils->sidlist[sid] = this;
}
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index 6582ba060..26171ee72 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -158,7 +158,7 @@ void TreeSocket::SendError(const std::string &errormessage)
void TreeSocket::SquitServer(std::string &from, TreeServer* Current, int& num_lost_servers, int& num_lost_users)
{
std::string servername = Current->GetName();
- ServerInstance->Logs->Log("m_spanningtree",DEBUG,"SquitServer for %s from %s",
+ ServerInstance->Logs->Log("m_spanningtree",LOG_DEBUG,"SquitServer for %s from %s",
servername.c_str(), from.c_str());
/* recursively squit the servers attached to 'Current'.
* We're going backwards so we don't remove users
@@ -220,7 +220,7 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason)
}
}
else
- ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Squit from unknown server");
+ ServerInstance->Logs->Log("m_spanningtree",LOG_DEFAULT,"Squit from unknown server");
}
/** This function is called when we receive data from a remote
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index bcf4cee12..e2eb31f0d 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -84,7 +84,7 @@ void TreeSocket::ProcessLine(std::string &line)
std::string command;
parameterlist params;
- ServerInstance->Logs->Log("m_spanningtree", RAWIO, "S[%d] I %s", this->GetFd(), line.c_str());
+ ServerInstance->Logs->Log("m_spanningtree", LOG_RAWIO, "S[%d] I %s", this->GetFd(), line.c_str());
Split(line, prefix, command, params);
@@ -259,7 +259,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
}
else
{
- ServerInstance->Logs->Log("m_spanningtree", DEBUG, "Command '%s' from unknown prefix '%s'! Dropping entire command.",
+ ServerInstance->Logs->Log("m_spanningtree", LOG_DEBUG, "Command '%s' from unknown prefix '%s'! Dropping entire command.",
command.c_str(), prefix.c_str());
return;
}
@@ -290,7 +290,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
if ((!route_back_again) || (route_back_again->GetSocket() != this))
{
if (route_back_again)
- ServerInstance->Logs->Log("m_spanningtree",DEBUG,"Protocol violation: Fake direction '%s' from connection '%s'",
+ ServerInstance->Logs->Log("m_spanningtree",LOG_DEBUG,"Protocol violation: Fake direction '%s' from connection '%s'",
prefix.c_str(),linkID.c_str());
return;
}
@@ -459,7 +459,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
if (!cmd)
{
irc::stringjoiner pmlist(" ", params, 0, params.size() - 1);
- ServerInstance->Logs->Log("m_spanningtree", SPARSE, "Unrecognised S2S command :%s %s %s",
+ ServerInstance->Logs->Log("m_spanningtree", LOG_SPARSE, "Unrecognised S2S command :%s %s %s",
who->uuid.c_str(), command.c_str(), pmlist.GetJoined().c_str());
SendError("Unrecognised command '" + command + "' -- possibly loaded mismatched modules");
return;
@@ -468,7 +468,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
if (params.size() < cmd->min_params)
{
irc::stringjoiner pmlist(" ", params, 0, params.size() - 1);
- ServerInstance->Logs->Log("m_spanningtree", SPARSE, "Insufficient parameters for S2S command :%s %s %s",
+ ServerInstance->Logs->Log("m_spanningtree", LOG_SPARSE, "Insufficient parameters for S2S command :%s %s %s",
who->uuid.c_str(), command.c_str(), pmlist.GetJoined().c_str());
SendError("Insufficient parameters for command '" + command + "'");
return;
@@ -487,7 +487,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
if (res == CMD_INVALID)
{
irc::stringjoiner pmlist(" ", params, 0, params.size() - 1);
- ServerInstance->Logs->Log("m_spanningtree", SPARSE, "Error handling S2S command :%s %s %s",
+ ServerInstance->Logs->Log("m_spanningtree", LOG_SPARSE, "Error handling S2S command :%s %s %s",
who->uuid.c_str(), command.c_str(), pmlist.GetJoined().c_str());
SendError("Error handling '" + command + "' -- possibly loaded mismatched modules");
}
diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp
index 3f73d8ee8..d6bded5e5 100644
--- a/src/modules/m_spanningtree/uid.cpp
+++ b/src/modules/m_spanningtree/uid.cpp
@@ -65,7 +65,7 @@ CmdResult CommandUID::Handle(const parameterlist &params, User* serversrc)
* Nick collision.
*/
int collide = sock->DoCollision(iter->second, age_t, params[5], params[6], params[0]);
- ServerInstance->Logs->Log("m_spanningtree",DEBUG,"*** Collision on %s, collide=%d", params[2].c_str(), collide);
+ ServerInstance->Logs->Log("m_spanningtree",LOG_DEBUG,"*** Collision on %s, collide=%d", params[2].c_str(), collide);
if (collide != 1)
{
@@ -88,7 +88,7 @@ CmdResult CommandUID::Handle(const parameterlist &params, User* serversrc)
}
catch (...)
{
- ServerInstance->Logs->Log("m_spanningtree", DEFAULT, "Duplicate UUID %s in client introduction", params[0].c_str());
+ ServerInstance->Logs->Log("m_spanningtree", LOG_DEFAULT, "Duplicate UUID %s in client introduction", params[0].c_str());
return CMD_INVALID;
}
(*(ServerInstance->Users->clientlist))[params[2]] = _new;
diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp
index 13d188432..1517ac1b9 100644
--- a/src/modules/m_spanningtree/utils.cpp
+++ b/src/modules/m_spanningtree/utils.cpp
@@ -132,7 +132,7 @@ TreeServer* SpanningTreeUtilities::FindServerID(const std::string &id)
SpanningTreeUtilities::SpanningTreeUtilities(ModuleSpanningTree* C) : Creator(C)
{
- ServerInstance->Logs->Log("m_spanningtree",DEBUG,"***** Using SID for hash: %s *****", ServerInstance->Config->GetSID().c_str());
+ ServerInstance->Logs->Log("m_spanningtree",LOG_DEBUG,"***** Using SID for hash: %s *****", ServerInstance->Config->GetSID().c_str());
this->TreeRoot = new TreeServer(this, ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc, ServerInstance->Config->GetSID());
this->ReadConfiguration();
@@ -298,7 +298,7 @@ void SpanningTreeUtilities::RefreshIPCache()
Link* L = *i;
if (!L->Port)
{
- ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"m_spanningtree: Ignoring a link block without a port.");
+ ServerInstance->Logs->Log("m_spanningtree",LOG_DEFAULT,"m_spanningtree: Ignoring a link block without a port.");
/* Invalid link block */
continue;
}
@@ -389,11 +389,11 @@ void SpanningTreeUtilities::ReadConfiguration()
if (L->IPAddr.empty())
{
L->IPAddr = "*";
- ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Configuration warning: Link block '" + assign(L->Name) + "' has no IP defined! This will allow any IP to connect as this server, and MAY not be what you want.");
+ ServerInstance->Logs->Log("m_spanningtree",LOG_DEFAULT,"Configuration warning: Link block '" + assign(L->Name) + "' has no IP defined! This will allow any IP to connect as this server, and MAY not be what you want.");
}
if (!L->Port)
- ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Configuration warning: Link block '" + assign(L->Name) + "' has no port defined, you will not be able to /connect it.");
+ ServerInstance->Logs->Log("m_spanningtree",LOG_DEFAULT,"Configuration warning: Link block '" + assign(L->Name) + "' has no port defined, you will not be able to /connect it.");
L->Fingerprint.erase(std::remove(L->Fingerprint.begin(), L->Fingerprint.end(), ':'), L->Fingerprint.end());
LinkBlocks.push_back(L);