[Logging] Logging Improvements (#2755)

* Console logging improvements

* stderr handling

* Add origination information

* Formatting

* Update zoneserver.cpp

* Update eqemu_logsys.cpp

* Remove semicolon from MySQLQuery log output

* Remove IsRfc5424LogCategory

* Remove no longer used functions

* Remove definition BUILD_LOGGING

* Deprecate categories UCSServer & WorldServer

* Deprecate UCS / World Server / Zone Server categories

* Deprecate Status, QSServer, Normal

* Update login_server.cpp

* Deprecate Emergency, Alert, Critical, Notice

* Deprecate Alert

* Fix terminal color resetting

* Deprecate headless client

* Move LogAIModerate to Detail

* Deprecate moderate logging level for detail

* Update logs.cpp

* Logs list simplify

* Update logs.cpp

* Add discord to log command

* Remove unused headers

* Windows fix

* Error in world when zones fail to load

* Show warning color properly

* Keep loginserver thread log from colliding with other logs during startup

* Deprecate Loginserver category
This commit is contained in:
Chris Miles
2023-01-17 21:18:40 -06:00
committed by GitHub
parent ee2079ec35
commit 40d1c33351
61 changed files with 1159 additions and 1109 deletions
+53 -32
View File
@@ -457,10 +457,10 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
return false;
}
LogClientLogin("[HandleSendLoginInfoPacket] Checking Auth id [{}]", id);
LogClientLogin("Checking authentication id [{}]", id);
if ((cle = client_list.CheckAuth(id, password))) {
LogClientLogin("[HandleSendLoginInfoPacket] Checking Auth id [{}] passed", id);
LogClientLogin("Checking authentication id [{}] passed", id);
if (!is_player_zoning) {
// Track who is in and who is out of the game
char *inout= (char *) "";
@@ -1604,17 +1604,38 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
in.s_addr = GetIP();
LogInfo("Character creation request from [{}] LS#[{}] ([{}]:[{}]) : ", GetCLE()->LSName(), GetCLE()->LSID(), inet_ntoa(in), GetPort());
LogInfo("Name: [{}]", name);
Log(Logs::Detail, Logs::WorldServer, "Race: %d Class: %d Gender: %d Deity: %d Start zone: %d Tutorial: %s",
cc->race, cc->class_, cc->gender, cc->deity, cc->start_zone, cc->tutorial ? "true" : "false");
LogInfo("STR STA AGI DEX WIS INT CHA Total");
Log(Logs::Detail, Logs::WorldServer, "%3d %3d %3d %3d %3d %3d %3d %3d",
cc->STR, cc->STA, cc->AGI, cc->DEX, cc->WIS, cc->INT, cc->CHA,
stats_sum);
LogInfo("Face: [{}] Eye colors: [{}] [{}]", cc->face, cc->eyecolor1, cc->eyecolor2);
LogInfo("Hairstyle: [{}] Haircolor: [{}]", cc->hairstyle, cc->haircolor);
LogInfo("Beard: [{}] Beardcolor: [{}]", cc->beard, cc->beardcolor);
LogInfo(
"Character creation request from [{}] LS [{}] [{}] [{}]",
GetCLE()->LSName(),
GetCLE()->LSID(),
inet_ntoa(in),
GetPort()
);
LogInfo("Name [{}]", name);
LogInfo(
"Race [{}] Class [{}] Gender [{}] Deity [{}] Start zone [{}] Tutorial [{}]",
cc->race,
cc->class_,
cc->gender,
cc->deity,
cc->start_zone,
cc->tutorial ? "true" : "false"
);
LogInfo("STR STA AGI DEX WIS INT CHA Total");
LogInfo(
" [{}] [{}] [{}] [{}] [{}] [{}] [{}] [{}]",
cc->STR,
cc->STA,
cc->AGI,
cc->DEX,
cc->WIS,
cc->INT,
cc->CHA,
stats_sum
);
LogInfo("Face [{}] Eye colors [{}] [{}]", cc->face, cc->eyecolor1, cc->eyecolor2);
LogInfo("Hairstyle [{}] Haircolor [{}]", cc->hairstyle, cc->haircolor);
LogInfo("Beard [{}] Beardcolor [{}]", cc->beard, cc->beardcolor);
/* Validate the char creation struct */
if (m_ClientVersionBit & EQ::versions::maskSoFAndLater) {
@@ -1685,14 +1706,14 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
/* If it is an SoF Client and the SoF Start Zone rule is set, send new chars there */
if (m_ClientVersionBit & EQ::versions::maskSoFAndLater) {
LogInfo("Found 'SoFStartZoneID' rule setting: [{}]", RuleI(World, SoFStartZoneID));
LogInfo("Found [SoFStartZoneID] rule setting [{}]", RuleI(World, SoFStartZoneID));
if (RuleI(World, SoFStartZoneID) > 0) {
pp.zone_id = RuleI(World, SoFStartZoneID);
cc->start_zone = pp.zone_id;
}
}
else {
LogInfo("Found 'TitaniumStartZoneID' rule setting: [{}]", RuleI(World, TitaniumStartZoneID));
LogInfo("Found [TitaniumStartZoneID] rule setting [{}]", RuleI(World, TitaniumStartZoneID));
if (RuleI(World, TitaniumStartZoneID) > 0) { /* if there's a startzone variable put them in there */
pp.zone_id = RuleI(World, TitaniumStartZoneID);
@@ -1757,12 +1778,12 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
pp.binds[0].heading = pp.heading;
}
Log(Logs::Detail, Logs::WorldServer, "Current location: %s (%d) %0.2f, %0.2f, %0.2f, %0.2f",
ZoneName(pp.zone_id), pp.zone_id, pp.x, pp.y, pp.z, pp.heading);
Log(Logs::Detail, Logs::WorldServer, "Bind location: %s (%d) %0.2f, %0.2f, %0.2f",
ZoneName(pp.binds[0].zone_id), pp.binds[0].zone_id, pp.binds[0].x, pp.binds[0].y, pp.binds[0].z);
Log(Logs::Detail, Logs::WorldServer, "Home location: %s (%d) %0.2f, %0.2f, %0.2f",
ZoneName(pp.binds[4].zone_id), pp.binds[4].zone_id, pp.binds[4].x, pp.binds[4].y, pp.binds[4].z);
LogInfo("Current location [{}] [{}] [{}] [{}] [{}] [{}]",
ZoneName(pp.zone_id), pp.zone_id, pp.x, pp.y, pp.z, pp.heading);
LogInfo("Bind location [{}] [{}] [{}] [{}] [{}]",
ZoneName(pp.binds[0].zone_id), pp.binds[0].zone_id, pp.binds[0].x, pp.binds[0].y, pp.binds[0].z);
LogInfo("Home location [{}] [{}] [{}] [{}] [{}]",
ZoneName(pp.binds[4].zone_id), pp.binds[4].zone_id, pp.binds[4].x, pp.binds[4].y, pp.binds[4].z);
/* Starting Items inventory */
content_db.SetStartingItems(&pp, &inv, pp.race, pp.class_, pp.deity, pp.zone_id, pp.name, GetAdmin());
@@ -1966,16 +1987,16 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc)
// if out of range looking it up in the table would crash stuff
// so we return from these
if (classtemp >= PLAYER_CLASS_COUNT) {
LogInfo(" class is out of range");
LogInfo(" class is out of range");
return false;
}
if (racetemp >= _TABLE_RACES) {
LogInfo(" race is out of range");
LogInfo(" race is out of range");
return false;
}
if (!ClassRaceLookupTable[classtemp][racetemp]) { //Lookup table better than a bunch of ifs?
LogInfo(" invalid race/class combination");
LogInfo(" invalid race/class combination");
// we return from this one, since if it's an invalid combination our table
// doesn't have meaningful values for the stats
return false;
@@ -2003,36 +2024,36 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc)
// that are messed up not just the first hit
if (bTOTAL + stat_points != cTOTAL) {
LogInfo(" stat points total doesn't match expected value: expecting [{}] got [{}]", bTOTAL + stat_points, cTOTAL);
LogInfo(" stat points total doesn't match expected value: expecting [{}] got [{}]", bTOTAL + stat_points, cTOTAL);
Charerrors++;
}
if (cc->STR > bSTR + stat_points || cc->STR < bSTR) {
LogInfo(" stat STR is out of range");
LogInfo(" stat STR is out of range");
Charerrors++;
}
if (cc->STA > bSTA + stat_points || cc->STA < bSTA) {
LogInfo(" stat STA is out of range");
LogInfo(" stat STA is out of range");
Charerrors++;
}
if (cc->AGI > bAGI + stat_points || cc->AGI < bAGI) {
LogInfo(" stat AGI is out of range");
LogInfo(" stat AGI is out of range");
Charerrors++;
}
if (cc->DEX > bDEX + stat_points || cc->DEX < bDEX) {
LogInfo(" stat DEX is out of range");
LogInfo(" stat DEX is out of range");
Charerrors++;
}
if (cc->WIS > bWIS + stat_points || cc->WIS < bWIS) {
LogInfo(" stat WIS is out of range");
LogInfo(" stat WIS is out of range");
Charerrors++;
}
if (cc->INT > bINT + stat_points || cc->INT < bINT) {
LogInfo(" stat INT is out of range");
LogInfo(" stat INT is out of range");
Charerrors++;
}
if (cc->CHA > bCHA + stat_points || cc->CHA < bCHA) {
LogInfo(" stat CHA is out of range");
LogInfo(" stat CHA is out of range");
Charerrors++;
}