Make logger automatically put a newline (#675)

at the end of the line
remove all the newlines in log calls
This commit is contained in:
Aaron Kimbrell
2022-07-24 21:26:51 -05:00
committed by GitHub
parent a7fb6eb3f3
commit e97ae92624
86 changed files with 1249 additions and 1252 deletions

View File

@@ -93,7 +93,7 @@ void Mail::SendMail(const LWOOBJID sender, const std::string& senderName, LWOOBJ
delete ins;
if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) return; // TODO: Echo to chat server
SendNotification(sysAddr, 1); //Show the "one new mail" message
}
@@ -152,7 +152,7 @@ void Mail::HandleMailStuff(RakNet::BitStream* packet, const SystemAddress& sysAd
Mail::HandleSendMail(packet, sysAddr, entity);
break;
default:
Game::logger->Log("Mail", "Unhandled and possibly undefined MailStuffID: %i\n", int(stuffID));
Game::logger->Log("Mail", "Unhandled and possibly undefined MailStuffID: %i", int(stuffID));
}
});
}
@@ -264,10 +264,10 @@ void Mail::HandleSendMail(RakNet::BitStream* packet, const SystemAddress& sysAdd
Mail::SendSendResponse(sysAddr, Mail::MailSendResponse::Success);
entity->GetCharacter()->SetCoins(entity->GetCharacter()->GetCoins() - mailCost, eLootSourceType::LOOT_SOURCE_MAIL);
Game::logger->Log("Mail", "Seeing if we need to remove item with ID/count/LOT: %i %i %i\n", itemID, attachmentCount, itemLOT);
Game::logger->Log("Mail", "Seeing if we need to remove item with ID/count/LOT: %i %i %i", itemID, attachmentCount, itemLOT);
if (inv && itemLOT != 0 && attachmentCount > 0 && item) {
Game::logger->Log("Mail", "Trying to remove item with ID/count/LOT: %i %i %i\n", itemID, attachmentCount, itemLOT);
Game::logger->Log("Mail", "Trying to remove item with ID/count/LOT: %i %i %i", itemID, attachmentCount, itemLOT);
inv->RemoveItem(itemLOT, attachmentCount, INVALID, true);
auto* missionCompoent = entity->GetComponent<MissionComponent>();

View File

@@ -29,7 +29,7 @@ Precondition::Precondition(const uint32_t condition) {
this->count = 1;
this->values = { 0 };
Game::logger->Log("Precondition", "Failed to find precondition of id (%i)!\n", condition);
Game::logger->Log("Precondition", "Failed to find precondition of id (%i)!", condition);
return;
}

View File

@@ -102,7 +102,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
break;
}
//Game::logger->Log("SlashCommandHandler", "Received chat command \"%s\"\n", GeneralUtils::UTF16ToWTF8(command).c_str());
//Game::logger->Log("SlashCommandHandler", "Received chat command \"%s\"", GeneralUtils::UTF16ToWTF8(command).c_str());
User* user = UserManager::Instance()->GetUser(sysAddr);
if ((chatCommand == "setgmlevel" || chatCommand == "makegm" || chatCommand == "gmlevel") && user->GetMaxGMLevel() > GAME_MASTER_LEVEL_CIVILIAN) {
@@ -145,7 +145,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
WorldPackets::SendGMLevelChange(sysAddr, success, user->GetMaxGMLevel(), entity->GetGMLevel(), level);
GameMessages::SendChatModeUpdate(entity->GetObjectID(), level);
entity->SetGMLevel(level);
Game::logger->Log("SlashCommandHandler", "User %s (%i) has changed their GM level to %i for charID %llu\n", user->GetUsername().c_str(), user->GetAccountID(), level, entity->GetObjectID());
Game::logger->Log("SlashCommandHandler", "User %s (%i) has changed their GM level to %i for charID %llu", user->GetUsername().c_str(), user->GetAccountID(), level, entity->GetObjectID());
}
}
@@ -170,7 +170,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
auto* character = entity->GetComponent<CharacterComponent>();
if (character == nullptr) {
Game::logger->Log("SlashCommandHandler", "Failed to find character component!\n");
Game::logger->Log("SlashCommandHandler", "Failed to find character component!");
return;
}
@@ -289,7 +289,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
args.InsertValue("visible", new AMFTrueValue());
args.InsertValue("text", text);
Game::logger->Log("SlashCommandHandler", "Sending \n%s\n", customText.c_str());
Game::logger->Log("SlashCommandHandler", "Sending %s", customText.c_str());
GameMessages::SendUIMessageServerToSingleClient(entity, entity->GetSystemAddress(), "ToggleStoryBox", &args);
});
@@ -324,7 +324,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
const auto sysAddr = entity->GetSystemAddress();
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i\n", entity->GetCharacter()->GetName().c_str(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", entity->GetCharacter()->GetName().c_str(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
if (entity->GetCharacter()) {
entity->GetCharacter()->SetZoneID(zoneID);
@@ -344,7 +344,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
ZoneInstanceManager::Instance()->RequestPrivateZone(Game::server, false, password, [=](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string serverIP, uint16_t serverPort)
{
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i\n", sysAddr.ToString(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", sysAddr.ToString(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
if (entity->GetCharacter()) {
entity->GetCharacter()->SetZoneID(zoneID);
@@ -920,7 +920,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
pos.SetY(y);
pos.SetZ(z);
Game::logger->Log("SlashCommandHandler", "Teleporting objectID: %llu to %f, %f, %f\n", entity->GetObjectID(), pos.x, pos.y, pos.z);
Game::logger->Log("SlashCommandHandler", "Teleporting objectID: %llu to %f, %f, %f", entity->GetObjectID(), pos.x, pos.y, pos.z);
GameMessages::SendTeleport(entity->GetObjectID(), pos, NiQuaternion(), sysAddr);
} else if (args.size() == 2) {
@@ -942,7 +942,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
pos.SetY(0.0f);
pos.SetZ(z);
Game::logger->Log("SlashCommandHandler", "Teleporting objectID: %llu to X: %f, Z: %f\n", entity->GetObjectID(), pos.x, pos.z);
Game::logger->Log("SlashCommandHandler", "Teleporting objectID: %llu to X: %f, Z: %f", entity->GetObjectID(), pos.x, pos.z);
GameMessages::SendTeleport(entity->GetObjectID(), pos, NiQuaternion(), sysAddr);
} else {
ChatPackets::SendSystemMessage(sysAddr, u"Correct usage: /teleport <x> (<y>) <z> - if no Y given, will teleport to the height of the terrain (or any physics object).");
@@ -964,7 +964,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
EntityManager::Instance()->SerializeEntity(possassableEntity);
Game::logger->Log("ClientPackets", "Forced updated vehicle position\n");
Game::logger->Log("ClientPackets", "Forced updated vehicle position");
}
}
}
@@ -1522,7 +1522,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
ChatPackets::SendSystemMessage(sysAddr, u"Transfering map...");
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i\n", sysAddr.ToString(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", sysAddr.ToString(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
if (entity->GetCharacter()) {
entity->GetCharacter()->SetZoneID(zoneID);
entity->GetCharacter()->SetZoneInstance(zoneInstance);

View File

@@ -48,7 +48,7 @@ void VanityUtilities::SpawnVanity()
std::vector<VanityNPC> npcList = m_NPCs;
std::vector<uint32_t> taken = {};
Game::logger->Log("VanityUtilities", "Spawning party with %i locations\n", party.m_Locations.size());
Game::logger->Log("VanityUtilities", "Spawning party with %i locations", party.m_Locations.size());
// Loop through all locations
for (const auto& location : party.m_Locations) {
@@ -187,7 +187,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* npcs = doc.FirstChildElement("npcs");
if (npcs == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPCs\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPCs");
return;
}
@@ -211,7 +211,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* locations = party->FirstChildElement("locations");
if (locations == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse party locations\n");
Game::logger->Log("VanityUtilities", "Failed to parse party locations");
continue;
}
@@ -228,7 +228,7 @@ void VanityUtilities::ParseXML(const std::string& file)
if (x == nullptr || y == nullptr || z == nullptr || rw == nullptr || rx == nullptr || ry == nullptr
|| rz == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse party location data\n");
Game::logger->Log("VanityUtilities", "Failed to parse party location data");
continue;
}
@@ -246,7 +246,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* partyPhrases = npcs->FirstChildElement("partyphrases");
if (partyPhrases == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse party phrases\n");
Game::logger->Log("VanityUtilities", "Failed to parse party phrases");
return;
}
@@ -256,7 +256,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* text = phrase->GetText();
if (text == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse party phrase\n");
Game::logger->Log("VanityUtilities", "Failed to parse party phrase");
continue;
}
@@ -268,7 +268,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* name = npc->Attribute("name");
if (name == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC name\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC name");
continue;
}
@@ -276,7 +276,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* lot = npc->Attribute("lot");
if (lot == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC lot\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC lot");
continue;
}
@@ -284,7 +284,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* equipment = npc->FirstChildElement("equipment");
if (equipment == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC equipment\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC equipment");
continue;
}
@@ -306,7 +306,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* phrases = npc->FirstChildElement("phrases");
if (phrases == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC phrases\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC phrases");
continue;
}
@@ -318,7 +318,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* text = phrase->GetText();
if (text == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC phrase\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC phrase");
continue;
}
@@ -334,7 +334,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* scriptNameAttribute = scriptElement->Attribute("name");
if (scriptNameAttribute == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC script name\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC script name");
continue;
}
@@ -358,7 +358,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* name = flag->Attribute("name");
if (name == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC flag name\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC flag name");
continue;
}
@@ -366,7 +366,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* value = flag->Attribute("value");
if (value == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC flag value\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC flag value");
continue;
}
@@ -380,7 +380,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* zoneID = zone->Attribute("id");
if (zoneID == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC zone ID\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC zone ID");
continue;
}
@@ -388,7 +388,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* locations = zone->FirstChildElement("locations");
if (locations == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC locations\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC locations");
continue;
}
@@ -405,7 +405,7 @@ void VanityUtilities::ParseXML(const std::string& file)
if (x == nullptr || y == nullptr || z == nullptr || rw == nullptr || rx == nullptr || ry == nullptr
|| rz == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC location data\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC location data");
continue;
}