diff --git a/common/database.cpp b/common/database.cpp index 45386ae90..05291b54b 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -1847,7 +1847,7 @@ const char* Database::GetRaidLeaderName(uint32 raid_id) auto results = QueryDatabase(query); if (!results.Success()) { - Log(Logs::General, Logs::Debug, "Unable to get Raid Leader Name for Raid ID: %u", raid_id); + LogDebug("Unable to get Raid Leader Name for Raid ID: [{}]", raid_id); return "UNKNOWN"; } diff --git a/ucs/chatchannel.cpp b/ucs/chatchannel.cpp index f7e566948..001f7b1e7 100644 --- a/ucs/chatchannel.cpp +++ b/ucs/chatchannel.cpp @@ -47,7 +47,7 @@ ChatChannel::ChatChannel(std::string inName, std::string inOwner, std::string in Moderated = false; - Log(Logs::Detail, Logs::UCSServer, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i", + LogInfo("New ChatChannel created: Name: [[{}]], Owner: [[{}]], Password: [[{}]], MinStatus: [{}]", Name.c_str(), Owner.c_str(), Password.c_str(), MinimumStatus); } @@ -402,7 +402,7 @@ void ChatChannel::SendMessageToChannel(std::string Message, Client* Sender) { if(ChannelClient) { - Log(Logs::Detail, Logs::UCSServer, "Sending message to %s from %s", + LogInfo("Sending message to [{}] from [{}]", ChannelClient->GetName().c_str(), Sender->GetName().c_str()); if (cv_messages[static_cast(ChannelClient->GetClientVersion())].length() == 0) { @@ -581,7 +581,7 @@ void ChatChannelList::Process() { if(CurrentChannel && CurrentChannel->ReadyToDelete()) { - Log(Logs::Detail, Logs::UCSServer, "Empty temporary password protected channel %s being destroyed.", + LogInfo("Empty temporary password protected channel [{}] being destroyed", CurrentChannel->GetName().c_str()); RemoveChannel(CurrentChannel); diff --git a/ucs/clientlist.cpp b/ucs/clientlist.cpp index 957c61f81..cd5215db3 100644 --- a/ucs/clientlist.cpp +++ b/ucs/clientlist.cpp @@ -304,7 +304,7 @@ static void ProcessMailTo(Client *c, std::string MailMessage) { if (!database.SendMail(Recipient, c->MailBoxName(), Subject, Body, RecipientsString)) { - Log(Logs::Detail, Logs::UCSServer, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(), + LogInfo("Failed in SendMail([{}], [{}], [{}], [{}])", Recipient.c_str(), c->MailBoxName().c_str(), Subject.c_str(), RecipientsString.c_str()); int PacketLength = 10 + Recipient.length() + Subject.length(); @@ -573,7 +573,7 @@ void Clientlist::CheckForStaleConnections(Client *c) { in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - Log(Logs::Detail, Logs::UCSServer, "Client connection from %s:%d closed.", inet_ntoa(in), + LogInfo("Client connection from [{}]:[{}] closed", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort())); safe_delete((*Iterator)); @@ -592,7 +592,7 @@ void Clientlist::Process() struct in_addr in; in.s_addr = (*it)->ClientStream->GetRemoteIP(); - Log(Logs::Detail, Logs::UCSServer, "Client connection from %s:%d closed.", inet_ntoa(in), + LogInfo("Client connection from [{}]:[{}] closed", inet_ntoa(in), ntohs((*it)->ClientStream->GetRemotePort())); safe_delete((*it)); @@ -618,8 +618,7 @@ void Clientlist::Process() VARSTRUCT_DECODE_STRING(MailBox, PacketBuffer); if (strlen(PacketBuffer) != 9) { - Log(Logs::Detail, Logs::UCSServer, - "Mail key is the wrong size. Version of world incompatible with UCS."); + LogInfo("Mail key is the wrong size. Version of world incompatible with UCS."); KeyValid = false; break; } @@ -640,12 +639,11 @@ void Clientlist::Process() else CharacterName = MailBoxString.substr(LastPeriod + 1); - Log(Logs::Detail, Logs::UCSServer, "Received login for user %s with key %s", + LogInfo("Received login for user [{}] with key [{}]", MailBox, Key); if (!database.VerifyMailKey(CharacterName, (*it)->ClientStream->GetRemoteIP(), Key)) { - Log(Logs::Detail, Logs::UCSServer, - "Chat Key for %s does not match, closing connection.", MailBox); + LogError("Chat Key for %s does not match, closing connection.", MailBox); KeyValid = false; break; } @@ -680,10 +678,9 @@ void Clientlist::Process() struct in_addr in; in.s_addr = (*it)->ClientStream->GetRemoteIP(); - Log(Logs::Detail, Logs::UCSServer, - "Force disconnecting client: %s:%d, KeyValid=%i, GetForceDisconnect()=%i", - inet_ntoa(in), ntohs((*it)->ClientStream->GetRemotePort()), KeyValid, - (*it)->GetForceDisconnect()); + LogInfo("Force disconnecting client: [{}]:[{}], KeyValid=[{}], GetForceDisconnect()=[{}]", + inet_ntoa(in), ntohs((*it)->ClientStream->GetRemotePort()), KeyValid, + (*it)->GetForceDisconnect()); (*it)->ClientStream->Close(); @@ -1392,7 +1389,7 @@ void Client::SendChannelMessageByNumber(std::string Message) { } } - Log(Logs::Detail, Logs::UCSServer, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(), + LogInfo("[{}] tells [{}], [[{}]]", GetName().c_str(), RequiredChannel->GetName().c_str(), Message.substr(MessageStart + 1).c_str()); if (RuleB(Chat, EnableAntiSpam)) @@ -2353,13 +2350,13 @@ std::string Client::MailBoxName() { if ((Characters.empty()) || (CurrentMailBox > (Characters.size() - 1))) { - Log(Logs::Detail, Logs::UCSServer, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", + LogInfo("MailBoxName() called with CurrentMailBox set to [{}] and Characters.size() is [{}]", CurrentMailBox, Characters.size()); return ""; } - Log(Logs::Detail, Logs::UCSServer, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", + LogInfo("MailBoxName() called with CurrentMailBox set to [{}] and Characters.size() is [{}]", CurrentMailBox, Characters.size()); return Characters[CurrentMailBox].Name; diff --git a/ucs/database.cpp b/ucs/database.cpp index fb8d176d8..28021db8f 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -213,7 +213,7 @@ int Database::FindCharacter(const char *characterName) safe_delete_array(safeCharName); if (results.RowCount() != 1) { - Log(Logs::Detail, Logs::UCSServer, "Bad result from FindCharacter query for character %s", + LogInfo("Bad result from FindCharacter query for character [{}]", characterName); return -1; } diff --git a/world/console.old.cpp b/world/console.old.cpp index fa5ca0ffe..185b95751 100644 --- a/world/console.old.cpp +++ b/world/console.old.cpp @@ -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) { diff --git a/world/eqw_http_handler.cpp b/world/eqw_http_handler.cpp index 9e0effb1e..5ae1b8b60 100644 --- a/world/eqw_http_handler.cpp +++ b/world/eqw_http_handler.cpp @@ -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); } diff --git a/world/eqw_parser.cpp b/world/eqw_parser.cpp index b0604924e..46cc4465c 100644 --- a/world/eqw_parser.cpp +++ b/world/eqw_parser.cpp @@ -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( diff --git a/zone/api_service.cpp b/zone/api_service.cpp index dc7a6cb76..b038da1a6 100644 --- a/zone/api_service.cpp +++ b/zone/api_service.cpp @@ -864,7 +864,7 @@ Json::Value ApiSetLoggingLevel(EQ::Net::WebsocketServerConnection *connection, J response["status"] = "Category doesn't exist"; - Log(Logs::General, Logs::Status, "Logging category is %i and level is %i", + LogInfo("Logging category is [{}] and level is [{}]", logging_category, logging_level ); diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index df995edf9..091109d1b 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -1088,14 +1088,14 @@ private: } static void status_report() { - Log(Logs::General, Logs::Commands, "load_bot_command_spells(): - 'RuleI(Bots, CommandSpellRank)' set to %i.", RuleI(Bots, CommandSpellRank)); + LogCommands("load_bot_command_spells(): - 'RuleI(Bots, CommandSpellRank)' set to [{}]", RuleI(Bots, CommandSpellRank)); if (bot_command_spells.empty()) { LogError("load_bot_command_spells() - 'bot_command_spells' is empty"); return; } for (int i = BCEnum::SpellTypeFirst; i <= BCEnum::SpellTypeLast; ++i) - Log(Logs::General, Logs::Commands, "load_bot_command_spells(): - '%s' returned %u spell entries.", + LogCommands("load_bot_command_spells(): - [{}] returned [{}] spell entries", BCEnum::SpellTypeEnumToString(static_cast(i)).c_str(), bot_command_spells[static_cast(i)].size()); } @@ -1431,12 +1431,12 @@ int bot_command_init(void) auto bot_command_settings_iter = bot_command_settings.find(working_bcl_iter.first); if (bot_command_settings_iter == bot_command_settings.end()) { if (working_bcl_iter.second->access == 0) - Log(Logs::General, Logs::Commands, "bot_command_init(): Warning: Bot Command '%s' defaulting to access level 0!", working_bcl_iter.first.c_str()); + LogCommands("bot_command_init(): Warning: Bot Command [{}] defaulting to access level 0!", working_bcl_iter.first.c_str()); continue; } working_bcl_iter.second->access = bot_command_settings_iter->second.first; - Log(Logs::General, Logs::Commands, "bot_command_init(): - Bot Command '%s' set to access level %d.", working_bcl_iter.first.c_str(), bot_command_settings_iter->second.first); + LogCommands("bot_command_init(): - Bot Command [{}] set to access level [{}]", working_bcl_iter.first.c_str(), bot_command_settings_iter->second.first); if (bot_command_settings_iter->second.second.empty()) continue; @@ -1444,14 +1444,14 @@ int bot_command_init(void) if (alias_iter.empty()) continue; if (bot_command_list.find(alias_iter) != bot_command_list.end()) { - Log(Logs::General, Logs::Commands, "bot_command_init(): Warning: Alias '%s' already exists as a bot command - skipping!", alias_iter.c_str()); + LogCommands("bot_command_init(): Warning: Alias [{}] already exists as a bot command - skipping!", alias_iter.c_str()); continue; } bot_command_list[alias_iter] = working_bcl_iter.second; bot_command_aliases[alias_iter] = working_bcl_iter.first; - Log(Logs::General, Logs::Commands, "bot_command_init(): - Alias '%s' added to bot command '%s'.", alias_iter.c_str(), bot_command_aliases[alias_iter].c_str()); + LogCommands("bot_command_init(): - Alias [{}] added to bot command [{}]", alias_iter.c_str(), bot_command_aliases[alias_iter].c_str()); } } @@ -1566,7 +1566,7 @@ int bot_command_real_dispatch(Client *c, const char *message) } if(cur->access >= COMMANDS_LOGGING_MIN_STATUS) { - Log(Logs::General, Logs::Commands, "%s (%s) used bot command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE"); + LogCommands("[{}] ([{}]) used bot command: [{}] (target=[{}])", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE"); } if(cur->function == nullptr) { @@ -4254,7 +4254,7 @@ void bot_subcommand_bot_clone(Client *c, const Seperator *sep) } if (!my_bot->GetBotID()) { c->Message(m_unknown, "An unknown error has occured - BotName: %s, BotID: %u", my_bot->GetCleanName(), my_bot->GetBotID()); - Log(Logs::General, Logs::Commands, "bot_command_clone(): - Error: Active bot reported invalid ID (BotName: %s, BotID: %u, OwnerName: %s, OwnerID: %u, AcctName: %s, AcctID: %u)", + LogCommands("bot_command_clone(): - Error: Active bot reported invalid ID (BotName: [{}], BotID: [{}], OwnerName: [{}], OwnerID: [{}], AcctName: [{}], AcctID: [{}])", my_bot->GetCleanName(), my_bot->GetBotID(), c->GetCleanName(), c->CharacterID(), c->AccountName(), c->AccountID()); return; } diff --git a/zone/client.cpp b/zone/client.cpp index d4b839071..7db9bc6d0 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -2558,7 +2558,7 @@ uint16 Client::GetMaxSkillAfterSpecializationRules(EQEmu::skills::SkillType skil Save(); - Log(Logs::General, Logs::Normal, "Reset %s's caster specialization skills to 1. " + LogInfo("Reset [{}]'s caster specialization skills to 1" "Too many specializations skills were above 50.", GetCleanName()); } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 35f5bf5d8..26ee719d8 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -2967,7 +2967,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) EQEmu::ItemInstance *itemOneToPush = nullptr, *itemTwoToPush = nullptr; - //Log(Logs::DebugLevel::Moderate, Logs::Debug, "cslot: %i aslot: %i cidx: %i aidx: %i act: %i dest: %i", + //Log(Logs::DebugLevel::Moderate, Logs::Debug, "cslot: [{}] aslot: [{}] cidx: [{}] aidx: [{}] act: [{}] dest: [{}]", // in_augment->container_slot, in_augment->augment_slot, in_augment->container_index, in_augment->augment_index, in_augment->augment_action, in_augment->dest_inst_id); EQEmu::ItemInstance *tobe_auged = nullptr, *old_aug = nullptr, *new_aug = nullptr, *aug = nullptr, *solvent = nullptr; @@ -4477,7 +4477,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) { is_client_moving = (ppu->y_pos == m_Position.y && ppu->x_pos == m_Position.x) ? false : true; if (is_client_moving) { - Log(Logs::Detail, Logs::Normal, "ClientUpdate: Client is moving - scan timer is: %u", + LogInfo("ClientUpdate: Client is moving - scan timer is: [{}]", client_scan_npc_aggro_timer.GetDuration()); if (client_scan_npc_aggro_timer.GetDuration() > 1000) { client_scan_npc_aggro_timer.Disable(); @@ -4485,7 +4485,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) { } } else { - Log(Logs::Detail, Logs::Normal, "ClientUpdate: Client is NOT moving - scan timer is: %u", + LogInfo("ClientUpdate: Client is NOT moving - scan timer is: [{}]", client_scan_npc_aggro_timer.GetDuration()); if (client_scan_npc_aggro_timer.GetDuration() < 1000) { client_scan_npc_aggro_timer.Disable(); @@ -4547,7 +4547,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) { /* Visual Debugging */ if (RuleB(Character, OPClientUpdateVisualDebug)) { - Log(Logs::General, Logs::Debug, "ClientUpdate: ppu x: %f y: %f z: %f h: %u", ppu->x_pos, ppu->y_pos, ppu->z_pos, + LogDebug("ClientUpdate: ppu x: [{}] y: [{}] z: [{}] h: [{}]", ppu->x_pos, ppu->y_pos, ppu->z_pos, ppu->heading); this->SendAppearanceEffect(78, 0, 0, 0, 0); this->SendAppearanceEffect(41, 0, 0, 0, 0); diff --git a/zone/command.cpp b/zone/command.cpp index a7e99bd01..d277fddfd 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -458,12 +458,12 @@ int command_init(void) auto iter_cs = command_settings.find(iter_cl->first); if (iter_cs == command_settings.end()) { if (iter_cl->second->access == 0) - Log(Logs::General, Logs::Commands, "command_init(): Warning: Command '%s' defaulting to access level 0!", iter_cl->first.c_str()); + LogCommands("command_init(): Warning: Command [{}] defaulting to access level 0!", iter_cl->first.c_str()); continue; } iter_cl->second->access = iter_cs->second.first; - Log(Logs::General, Logs::Commands, "command_init(): - Command '%s' set to access level %d.", iter_cl->first.c_str(), iter_cs->second.first); + LogCommands("command_init(): - Command [{}] set to access level [{}]", iter_cl->first.c_str(), iter_cs->second.first); if (iter_cs->second.second.empty()) continue; @@ -472,14 +472,14 @@ int command_init(void) if (iter_aka->empty()) continue; if (commandlist.find(*iter_aka) != commandlist.end()) { - Log(Logs::General, Logs::Commands, "command_init(): Warning: Alias '%s' already exists as a command - skipping!", iter_aka->c_str()); + LogCommands("command_init(): Warning: Alias [{}] already exists as a command - skipping!", iter_aka->c_str()); continue; } commandlist[*iter_aka] = iter_cl->second; commandaliases[*iter_aka] = iter_cl->first; - Log(Logs::General, Logs::Commands, "command_init(): - Alias '%s' added to command '%s'.", iter_aka->c_str(), commandaliases[*iter_aka].c_str()); + LogCommands("command_init(): - Alias [{}] added to command [{}]", iter_aka->c_str(), commandaliases[*iter_aka].c_str()); } } @@ -587,7 +587,7 @@ int command_realdispatch(Client *c, const char *message) } if(cur->access >= COMMANDS_LOGGING_MIN_STATUS) { - Log(Logs::General, Logs::Commands, "%s (%s) used command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE"); + LogCommands("[{}] ([{}]) used command: [{}] (target=[{}])", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE"); } if(cur->function == nullptr) { @@ -8519,7 +8519,7 @@ void command_ucs(Client *c, const Seperator *sep) if (!c) return; - Log(Logs::Detail, Logs::UCSServer, "Character %s attempting ucs reconnect while ucs server is %savailable", + LogInfo("Character [{}] attempting ucs reconnect while ucs server is [{}] available", c->GetName(), (zone->IsUCSServerAvailable() ? "" : "un")); if (zone->IsUCSServerAvailable()) { @@ -12210,7 +12210,7 @@ void command_logtest(Client *c, const Seperator *sep){ uint32 i = 0; t = std::clock(); for (i = 0; i < atoi(sep->arg[1]); i++){ - Log(Logs::General, Logs::Debug, "[%u] Test #2... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + LogDebug("[[{}]] Test #2 Took [{}] seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); } } @@ -12308,7 +12308,7 @@ void command_mysqltest(Client *c, const Seperator *sep) auto results = database.QueryDatabase(query); } } - Log(Logs::General, Logs::Debug, "MySQL Test... Took %f seconds", ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + LogDebug("MySQL Test Took [{}] seconds", ((float)(std::clock() - t)) / CLOCKS_PER_SEC); } void command_resetaa_timer(Client *c, const Seperator *sep) { diff --git a/zone/embperl.cpp b/zone/embperl.cpp index bc20bd4ef..22c248fd7 100644 --- a/zone/embperl.cpp +++ b/zone/embperl.cpp @@ -140,12 +140,12 @@ void Embperl::DoInit() { catch(const char *err) { //remember... lasterr() is no good if we crap out here, in construction - Log(Logs::General, Logs::Quests, "perl error: %s", err); + LogQuests("perl error: [{}]", err); throw "failed to install eval_file hook"; } #ifdef EMBPERL_IO_CAPTURE - Log(Logs::General, Logs::Quests, "Tying perl output to eqemu logs"); + LogQuests("Tying perl output to eqemu logs"); //make a tieable class to capture IO and pass it into EQEMuLog eval_pv( "package EQEmuIO; " @@ -170,7 +170,7 @@ void Embperl::DoInit() { ,FALSE ); - Log(Logs::General, Logs::Quests, "Loading perlemb plugins."); + LogQuests("Loading perlemb plugins"); try { std::string perl_command; @@ -179,7 +179,7 @@ void Embperl::DoInit() { } catch(const char *err) { - Log(Logs::General, Logs::Quests, "Warning - %s: %s", Config->PluginPlFile.c_str(), err); + LogQuests("Warning - [{}]: [{}]", Config->PluginPlFile.c_str(), err); } try { @@ -197,7 +197,7 @@ void Embperl::DoInit() { } catch(const char *err) { - Log(Logs::General, Logs::Quests, "Perl warning: %s", err); + LogQuests("Perl warning: [{}]", err); } #endif //EMBPERL_PLUGIN in_use = false; diff --git a/zone/pathfinder_waypoint.cpp b/zone/pathfinder_waypoint.cpp index 886ca197f..58dcd1582 100644 --- a/zone/pathfinder_waypoint.cpp +++ b/zone/pathfinder_waypoint.cpp @@ -258,7 +258,7 @@ void PathfinderWaypoint::Load(const std::string &filename) { fread(&Head, sizeof(Head), 1, f); - Log(Logs::General, Logs::Status, "Path File Header: Version %ld, PathNodes %ld", + LogInfo("Path File Header: Version [{}], PathNodes [{}]", (long)Head.version, (long)Head.PathNodeCount); if (Head.version == 2) diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 64e5bd008..d7b3299cd 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -157,7 +157,7 @@ void QuestManager::echo(int colour, const char *str) { void QuestManager::say(const char *str, Journal::Options &opts) { QuestManagerCurrentQuestVars(); if (!owner) { - Log(Logs::General, Logs::Quests, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); + LogQuests("QuestManager::say called with nullptr owner. Probably syntax error in quest file"); return; } else { @@ -558,7 +558,7 @@ void QuestManager::pausetimer(const char *timer_name) { { if (pcur->owner && pcur->owner == owner && pcur->name == timer_name) { - Log(Logs::General, Logs::Quests, "Timer %s is already paused for %s. Returning...", timer_name, owner->GetName()); + LogQuests("Timer [{}] is already paused for [{}]. Returning", timer_name, owner->GetName()); return; } ++pcur; @@ -580,7 +580,7 @@ void QuestManager::pausetimer(const char *timer_name) { pt.name = timername; pt.owner = owner; pt.time = milliseconds; - Log(Logs::General, Logs::Quests, "Pausing timer %s for %s with %d ms remaining.", timer_name, owner->GetName(), milliseconds); + LogQuests("Pausing timer [{}] for [{}] with [{}] ms remaining", timer_name, owner->GetName(), milliseconds); PTimerList.push_back(pt); } @@ -606,7 +606,7 @@ void QuestManager::resumetimer(const char *timer_name) { if (milliseconds == 0) { - Log(Logs::General, Logs::Quests, "Paused timer %s not found or has expired. Returning...", timer_name); + LogQuests("Paused timer [{}] not found or has expired. Returning", timer_name); return; } @@ -617,14 +617,14 @@ void QuestManager::resumetimer(const char *timer_name) { { cur->Timer_.Enable(); cur->Timer_.Start(milliseconds, false); - Log(Logs::General, Logs::Quests, "Resuming timer %s for %s with %d ms remaining.", timer_name, owner->GetName(), milliseconds); + LogQuests("Resuming timer [{}] for [{}] with [{}] ms remaining", timer_name, owner->GetName(), milliseconds); return; } ++cur; } QTimerList.push_back(QuestTimer(milliseconds, owner, timer_name)); - Log(Logs::General, Logs::Quests, "Creating a new timer and resuming %s for %s with %d ms remaining.", timer_name, owner->GetName(), milliseconds); + LogQuests("Creating a new timer and resuming [{}] for [{}] with [{}] ms remaining", timer_name, owner->GetName(), milliseconds); } @@ -649,7 +649,7 @@ bool QuestManager::ispausedtimer(const char *timer_name) { void QuestManager::emote(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log(Logs::General, Logs::Quests, "QuestManager::emote called with nullptr owner. Probably syntax error in quest file."); + LogQuests("QuestManager::emote called with nullptr owner. Probably syntax error in quest file"); return; } else { @@ -660,7 +660,7 @@ void QuestManager::emote(const char *str) { void QuestManager::shout(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log(Logs::General, Logs::Quests, "QuestManager::shout called with nullptr owner. Probably syntax error in quest file."); + LogQuests("QuestManager::shout called with nullptr owner. Probably syntax error in quest file"); return; } else { @@ -671,7 +671,7 @@ void QuestManager::shout(const char *str) { void QuestManager::shout2(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log(Logs::General, Logs::Quests, "QuestManager::shout2 called with nullptr owner. Probably syntax error in quest file."); + LogQuests("QuestManager::shout2 called with nullptr owner. Probably syntax error in quest file"); return; } else { @@ -690,7 +690,7 @@ void QuestManager::gmsay(const char *str, uint32 color, bool send_to_world, uint void QuestManager::depop(int npc_type) { QuestManagerCurrentQuestVars(); if (!owner || !owner->IsNPC()) { - Log(Logs::General, Logs::Quests, "QuestManager::depop called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); + LogQuests("QuestManager::depop called with nullptr owner or non-NPC owner. Probably syntax error in quest file"); return; } else { @@ -720,7 +720,7 @@ void QuestManager::depop(int npc_type) { void QuestManager::depop_withtimer(int npc_type) { QuestManagerCurrentQuestVars(); if (!owner || !owner->IsNPC()) { - Log(Logs::General, Logs::Quests, "QuestManager::depop_withtimer called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); + LogQuests("QuestManager::depop_withtimer called with nullptr owner or non-NPC owner. Probably syntax error in quest file"); return; } else { @@ -747,7 +747,7 @@ void QuestManager::depopall(int npc_type) { entity_list.DepopAll(npc_type); } else { - Log(Logs::General, Logs::Quests, "QuestManager::depopall called with nullptr owner, non-NPC owner, or invalid NPC Type ID. Probably syntax error in quest file."); + LogQuests("QuestManager::depopall called with nullptr owner, non-NPC owner, or invalid NPC Type ID. Probably syntax error in quest file"); } } @@ -756,7 +756,7 @@ void QuestManager::depopzone(bool StartSpawnTimer) { zone->Depop(StartSpawnTimer); } else { - Log(Logs::General, Logs::Quests, "QuestManager::depopzone called with nullptr zone. Probably syntax error in quest file."); + LogQuests("QuestManager::depopzone called with nullptr zone. Probably syntax error in quest file"); } } @@ -765,7 +765,7 @@ void QuestManager::repopzone() { zone->Repop(); } else { - Log(Logs::General, Logs::Quests, "QuestManager::repopzone called with nullptr zone. Probably syntax error in quest file."); + LogQuests("QuestManager::repopzone called with nullptr zone. Probably syntax error in quest file"); } } @@ -1825,7 +1825,7 @@ void QuestManager::showgrid(int grid) { "ORDER BY `number`", grid, zone->GetZoneID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log(Logs::General, Logs::Quests, "Error loading grid %d for showgrid(): %s", grid, results.ErrorMessage().c_str()); + LogQuests("Error loading grid [{}] for showgrid(): [{}]", grid, results.ErrorMessage().c_str()); return; } @@ -2978,7 +2978,7 @@ void QuestManager::voicetell(const char *str, int macronum, int racenum, int gen safe_delete(outapp); } else - Log(Logs::General, Logs::Quests, "QuestManager::voicetell from %s. Client %s not found.", owner->GetName(), str); + LogQuests("QuestManager::voicetell from [{}]. Client [{}] not found", owner->GetName(), str); } } diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 8e5a6a78a..693333df4 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -4712,7 +4712,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo return 0; break; default: - Log(Logs::General, Logs::Normal, "CalcFocusEffect: unknown limit spelltype %d", + LogInfo("CalcFocusEffect: unknown limit spelltype [{}]", focus_spell.base[i]); } break; @@ -5090,7 +5090,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo // this spits up a lot of garbage when calculating spell focuses // since they have all kinds of extra effects on them. default: - Log(Logs::General, Logs::Normal, "CalcFocusEffect: unknown effectid %d", + LogInfo("CalcFocusEffect: unknown effectid [{}]", focus_spell.effectid[i]); #endif } diff --git a/zone/water_map.cpp b/zone/water_map.cpp index 3d8871aea..d2e6daad1 100644 --- a/zone/water_map.cpp +++ b/zone/water_map.cpp @@ -14,30 +14,30 @@ WaterMap* WaterMap::LoadWaterMapfile(std::string zone_name) { std::transform(zone_name.begin(), zone_name.end(), zone_name.begin(), ::tolower); std::string file_path = Config->MapDir + "water/" + zone_name + std::string(".wtr"); - Log(Logs::General, Logs::Debug, "Attempting to load water map with path %s", file_path.c_str()); + LogDebug("Attempting to load water map with path [{}]", file_path.c_str()); FILE *f = fopen(file_path.c_str(), "rb"); if(f) { char magic[10]; uint32 version; if(fread(magic, 10, 1, f) != 1) { - Log(Logs::General, Logs::Debug, "Failed to load water map, error reading magic string in header."); + LogDebug("Failed to load water map, error reading magic string in header"); fclose(f); return nullptr; } if(strncmp(magic, "EQEMUWATER", 10)) { - Log(Logs::General, Logs::Debug, "Failed to load water map, bad magic string in header."); + LogDebug("Failed to load water map, bad magic string in header"); fclose(f); return nullptr; } if(fread(&version, sizeof(version), 1, f) != 1) { - Log(Logs::General, Logs::Debug, "Failed to load water map, error reading version."); + LogDebug("Failed to load water map, error reading version"); fclose(f); return nullptr; } - Log(Logs::General, Logs::Debug, "Attempting to V%u load water map %s.", version, file_path.c_str()); + LogDebug("Attempting to V[{}] load water map [{}]", version, file_path.c_str()); if(version == 1) { auto wm = new WaterMapV1(); if(!wm->Load(f)) { @@ -61,12 +61,12 @@ WaterMap* WaterMap::LoadWaterMapfile(std::string zone_name) { fclose(f); return wm; } else { - Log(Logs::General, Logs::Debug, "Failed to load water map, unsupported version V%u.", version); + LogDebug("Failed to load water map, unsupported version V[{}]", version); fclose(f); return nullptr; } } - Log(Logs::General, Logs::Debug, "Failed to load water map, could not open file for reading %s.", file_path.c_str()); + LogDebug("Failed to load water map, could not open file for reading [{}]", file_path.c_str()); return nullptr; } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 80d15c022..06313872d 100755 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -204,7 +204,7 @@ bool ZoneDatabase::GetZoneCFG( //not in the DB yet: zone_data->gravity = atof(row[56]); - Log(Logs::General, Logs::Debug, "Zone Gravity is %f", zone_data->gravity); + LogDebug("Zone Gravity is [{}]", zone_data->gravity); allow_mercs = true; zone_data->FastRegenHP = atoi(row[57]); @@ -2382,7 +2382,7 @@ const NPCType *ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load std::string where_condition = ""; if (bulk_load) { - Log(Logs::General, Logs::Debug, "Performing bulk NPC Types load"); + LogDebug("Performing bulk NPC Types load"); where_condition = StringFormat( "INNER JOIN spawnentry ON npc_types.id = spawnentry.npcID " "INNER JOIN spawn2 ON spawnentry.spawngroupID = spawn2.spawngroupID "