[Performance] Reworked how all log calls are made in the source, see changelog.txt for more details

This commit is contained in:
Akkadius
2017-04-01 03:51:46 -05:00
parent 93a6efa95f
commit 7aa1d243b0
131 changed files with 3126 additions and 3066 deletions
+13 -13
View File
@@ -22,7 +22,7 @@ extern LoginServer server;
extern bool run_server;
#include "../common/eqemu_logsys.h"
extern EQEmuLogSys Log;
extern EQEmuLogSys LogSys;
ClientManager::ClientManager()
{
@@ -31,18 +31,18 @@ ClientManager::ClientManager()
titanium_ops = new RegularOpcodeManager;
if(!titanium_ops->LoadOpcodes(server.config->GetVariable("Titanium", "opcodes").c_str()))
{
Log.Out(Logs::General, Logs::Error, "ClientManager fatal error: couldn't load opcodes for Titanium file %s.",
Log(Logs::General, Logs::Error, "ClientManager fatal error: couldn't load opcodes for Titanium file %s.",
server.config->GetVariable("Titanium", "opcodes").c_str());
run_server = false;
}
if(titanium_stream->Open())
{
Log.Out(Logs::General, Logs::Login_Server, "ClientManager listening on Titanium stream.");
Log(Logs::General, Logs::Login_Server, "ClientManager listening on Titanium stream.");
}
else
{
Log.Out(Logs::General, Logs::Error, "ClientManager fatal error: couldn't open Titanium stream.");
Log(Logs::General, Logs::Error, "ClientManager fatal error: couldn't open Titanium stream.");
run_server = false;
}
@@ -51,18 +51,18 @@ ClientManager::ClientManager()
sod_ops = new RegularOpcodeManager;
if(!sod_ops->LoadOpcodes(server.config->GetVariable("SoD", "opcodes").c_str()))
{
Log.Out(Logs::General, Logs::Error, "ClientManager fatal error: couldn't load opcodes for SoD file %s.",
Log(Logs::General, Logs::Error, "ClientManager fatal error: couldn't load opcodes for SoD file %s.",
server.config->GetVariable("SoD", "opcodes").c_str());
run_server = false;
}
if(sod_stream->Open())
{
Log.Out(Logs::General, Logs::Login_Server, "ClientManager listening on SoD stream.");
Log(Logs::General, Logs::Login_Server, "ClientManager listening on SoD stream.");
}
else
{
Log.Out(Logs::General, Logs::Error, "ClientManager fatal error: couldn't open SoD stream.");
Log(Logs::General, Logs::Error, "ClientManager fatal error: couldn't open SoD stream.");
run_server = false;
}
}
@@ -100,7 +100,7 @@ void ClientManager::Process()
{
struct in_addr in;
in.s_addr = cur->GetRemoteIP();
Log.Out(Logs::General, Logs::Login_Server, "New Titanium client connection from %s:%d", inet_ntoa(in), ntohs(cur->GetRemotePort()));
Log(Logs::General, Logs::Login_Server, "New Titanium client connection from %s:%d", inet_ntoa(in), ntohs(cur->GetRemotePort()));
cur->SetOpcodeManager(&titanium_ops);
Client *c = new Client(cur, cv_titanium);
@@ -113,7 +113,7 @@ void ClientManager::Process()
{
struct in_addr in;
in.s_addr = cur->GetRemoteIP();
Log.Out(Logs::General, Logs::Login_Server, "New SoD client connection from %s:%d", inet_ntoa(in), ntohs(cur->GetRemotePort()));
Log(Logs::General, Logs::Login_Server, "New SoD client connection from %s:%d", inet_ntoa(in), ntohs(cur->GetRemotePort()));
cur->SetOpcodeManager(&sod_ops);
Client *c = new Client(cur, cv_sod);
@@ -126,7 +126,7 @@ void ClientManager::Process()
{
if((*iter)->Process() == false)
{
Log.Out(Logs::General, Logs::Debug, "Client had a fatal error and had to be removed from the login.");
Log(Logs::General, Logs::Debug, "Client had a fatal error and had to be removed from the login.");
delete (*iter);
iter = clients.erase(iter);
}
@@ -145,7 +145,7 @@ void ClientManager::ProcessDisconnect()
std::shared_ptr<EQStream> c = (*iter)->GetConnection();
if(c->CheckClosed())
{
Log.Out(Logs::General, Logs::Login_Server, "Client disconnected from the server, removing client.");
Log(Logs::General, Logs::Login_Server, "Client disconnected from the server, removing client.");
delete (*iter);
iter = clients.erase(iter);
}
@@ -173,7 +173,7 @@ void ClientManager::RemoveExistingClient(unsigned int account_id)
{
if((*iter)->GetAccountID() == account_id)
{
Log.Out(Logs::General, Logs::Login_Server, "Client attempting to log in and existing client already logged in, removing existing client.");
Log(Logs::General, Logs::Login_Server, "Client attempting to log in and existing client already logged in, removing existing client.");
delete (*iter);
iter = clients.erase(iter);
}
@@ -201,7 +201,7 @@ Client *ClientManager::GetClient(unsigned int account_id)
if(count > 1)
{
Log.Out(Logs::General, Logs::Error, "More than one client with a given account_id existed in the client list.");
Log(Logs::General, Logs::Error, "More than one client with a given account_id existed in the client list.");
}
return cur;
}