More log migrations to fmt / log aliases

This commit is contained in:
Akkadius
2019-09-02 02:33:02 -05:00
parent 2b1950d2e2
commit 2970afff67
18 changed files with 93 additions and 96 deletions
+11 -11
View File
@@ -88,7 +88,7 @@ void Console::Die() {
state = CONSOLE_STATE_CLOSED;
struct in_addr in;
in.s_addr = GetIP();
Log(Logs::Detail, Logs::World_Server,"Removing console from %s:%d",inet_ntoa(in),GetPort());
LogInfo("Removing console from [{}]:[{}]",inet_ntoa(in),GetPort());
tcpc->Disconnect();
}
@@ -219,7 +219,7 @@ bool Console::Process() {
if (!tcpc->Connected()) {
struct in_addr in;
in.s_addr = GetIP();
Log(Logs::Detail, Logs::World_Server,"Removing console (!tcpc->Connected) from %s:%d",inet_ntoa(in),GetPort());
LogInfo("Removing console (!tcpc->Connected) from [{}]:[{}]",inet_ntoa(in),GetPort());
return false;
}
//if we have not gotten the special markers after this timer, send login prompt
@@ -252,7 +252,7 @@ bool Console::Process() {
SendMessage(1, "Timeout, disconnecting...");
struct in_addr in;
in.s_addr = GetIP();
Log(Logs::Detail, Logs::World_Server,"TCP connection timeout from %s:%d",inet_ntoa(in),GetPort());
LogInfo("TCP connection timeout from [{}]:[{}]",inet_ntoa(in),GetPort());
return false;
}
@@ -261,29 +261,29 @@ bool Console::Process() {
in.s_addr = GetIP();
if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeZone) {
auto zs = new ZoneServer(tcpc);
Log(Logs::Detail, Logs::World_Server,"New zoneserver #%d from %s:%d", zs->GetID(), inet_ntoa(in), GetPort());
LogInfo("New zoneserver #[{}] from [{}]:[{}]", zs->GetID(), inet_ntoa(in), GetPort());
zoneserver_list.Add(zs);
numzones++;
tcpc = 0;
} else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeLauncher) {
Log(Logs::Detail, Logs::World_Server,"New launcher from %s:%d", inet_ntoa(in), GetPort());
LogInfo("New launcher from [{}]:[{}]", inet_ntoa(in), GetPort());
launcher_list.Add(tcpc);
tcpc = 0;
}
else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeUCS)
{
Log(Logs::Detail, Logs::World_Server,"New UCS Connection from %s:%d", inet_ntoa(in), GetPort());
LogInfo("New UCS Connection from [{}]:[{}]", inet_ntoa(in), GetPort());
UCSLink.SetConnection(tcpc);
tcpc = 0;
}
else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeQueryServ)
{
Log(Logs::Detail, Logs::World_Server,"New QS Connection from %s:%d", inet_ntoa(in), GetPort());
LogInfo("New QS Connection from [{}]:[{}]", inet_ntoa(in), GetPort());
QSLink.SetConnection(tcpc);
tcpc = 0;
}
else {
Log(Logs::Detail, Logs::World_Server,"Unsupported packet mode from %s:%d", inet_ntoa(in), GetPort());
LogInfo("Unsupported packet mode from [{}]:[{}]", inet_ntoa(in), GetPort());
}
return false;
}
@@ -440,7 +440,7 @@ void Console::ProcessCommand(const char* command) {
state = CONSOLE_STATE_CLOSED;
return;
}
Log(Logs::Detail, Logs::World_Server,"TCP console authenticated: Username=%s, Admin=%d",paccountname,admin);
LogInfo("TCP console authenticated: Username=[{}], Admin=[{}]",paccountname,admin);
SendMessage(1, 0);
SendMessage(2, "Login accepted.");
state = CONSOLE_STATE_CONNECTED;
@@ -737,7 +737,7 @@ void Console::ProcessCommand(const char* command) {
tmpname[0] = '*';
strcpy(&tmpname[1], paccountname);
Log(Logs::Detail, Logs::World_Server,"Console ZoneBootup: %s, %s, %s",tmpname,sep.arg[2],sep.arg[1]);
LogInfo("Console ZoneBootup: [{}], [{}], [{}]",tmpname,sep.arg[2],sep.arg[1]);
zoneserver_list.SOPZoneBootup(tmpname, atoi(sep.arg[1]), sep.arg[2], (bool) (strcasecmp(sep.arg[3], "static") == 0));
}
}
@@ -821,7 +821,7 @@ void Console::ProcessCommand(const char* command) {
#endif
RunLoops = true;
SendMessage(1, " Login Server Reconnect manually restarted by Console");
Log(Logs::Detail, Logs::World_Server,"Login Server Reconnect manually restarted by Console");
LogInfo("Login Server Reconnect manually restarted by Console");
}
else if (strcasecmp(sep.arg[0], "zonelock") == 0 && admin >= consoleZoneStatus) {
if (strcasecmp(sep.arg[1], "list") == 0) {
+7 -7
View File
@@ -139,11 +139,11 @@ bool EQWHTTPHandler::CheckAuth() const {
int16 status = 0;
uint32 acctid = database.CheckLogin(m_username.c_str(), m_password.c_str(), &status);
if(acctid == 0) {
Log(Logs::Detail, Logs::World_Server, "Login autentication failed for %s with '%s'", m_username.c_str(), m_password.c_str());
LogInfo("Login autentication failed for [{}] with [{}]", m_username.c_str(), m_password.c_str());
return(false);
}
if(status < httpLoginStatus) {
Log(Logs::Detail, Logs::World_Server, "Login of %s failed: status too low.", m_username.c_str());
LogInfo("Login of [{}] failed: status too low", m_username.c_str());
return(false);
}
@@ -278,29 +278,29 @@ void EQWHTTPServer::CreateNewConnection(uint32 ID, SOCKET in_socket, uint32 irIP
}
void EQWHTTPServer::Stop() {
Log(Logs::Detail, Logs::World_Server, "Requesting that HTTP Service stop.");
LogInfo("Requesting that HTTP Service stop");
m_running = false;
Close();
}
bool EQWHTTPServer::Start(uint16 port, const char *mime_file) {
if(m_running) {
Log(Logs::Detail, Logs::World_Server, "HTTP Service is already running on port %d", m_port);
LogInfo("HTTP Service is already running on port [{}]", m_port);
return(false);
}
//load up our nice mime types
if(!EQWHTTPHandler::LoadMimeTypes(mime_file)) {
Log(Logs::Detail, Logs::World_Server, "Failed to load mime types from '%s'", mime_file);
LogInfo("Failed to load mime types from [{}]", mime_file);
return(false);
} else {
Log(Logs::Detail, Logs::World_Server, "Loaded mime types from %s", mime_file);
LogInfo("Loaded mime types from [{}]", mime_file);
}
//fire up the server thread
char errbuf[TCPServer_ErrorBufferSize];
if(!Open(port, errbuf)) {
Log(Logs::Detail, Logs::World_Server, "Unable to bind to port %d for HTTP service: %s", port, errbuf);
LogInfo("Unable to bind to port [{}] for HTTP service: [{}]", port, errbuf);
return(false);
}
+3 -3
View File
@@ -65,7 +65,7 @@ EQWParser::EQWParser() {
my_perl = perl_alloc();
_empty_sv = newSV(0);
if (!my_perl) {
Log(Logs::Detail, Logs::World_Server, "Error: perl_alloc failed!");
LogInfo("Error: perl_alloc failed!");
}
else {
DoInit();
@@ -184,10 +184,10 @@ void EQWParser::DoInit() {
#ifdef EMBPERL_PLUGIN
Log(Logs::Detail, Logs::World_Server, "Loading worldui perl plugins.");
LogInfo("Loading worldui perl plugins");
std::string err;
if(!eval_file("world", "worldui.pl", err)) {
Log(Logs::Detail, Logs::World_Server, "Warning - world.pl: %s", err.c_str());
LogInfo("Warning - world.pl: [{}]", err.c_str());
}
eval_pv(