diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index 901c21464..ebe91353c 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -39,7 +39,7 @@ int main(int argc, char **argv) { LogSys.LoadLogSettingsDefaults(); set_exception_handler(); - Log(Logs::General, Logs::Status, "Client Files Export Utility"); + LogInfo("Client Files Export Utility"); if(!EQEmuConfig::LoadConfig()) { LogError("Unable to load configuration file"); return 1; @@ -48,7 +48,7 @@ int main(int argc, char **argv) { auto Config = EQEmuConfig::get(); SharedDatabase database; - Log(Logs::General, Logs::Status, "Connecting to database..."); + LogInfo("Connecting to database"); if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { LogError("Unable to connect to the database, cannot continue without a database connection"); @@ -93,7 +93,7 @@ int main(int argc, char **argv) { } void ExportSpells(SharedDatabase *db) { - Log(Logs::General, Logs::Status, "Exporting Spells..."); + LogInfo("Exporting Spells"); FILE *f = fopen("export/spells_us.txt", "w"); if(!f) { @@ -164,7 +164,7 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) { } void ExportSkillCaps(SharedDatabase *db) { - Log(Logs::General, Logs::Status, "Exporting Skill Caps..."); + LogInfo("Exporting Skill Caps"); FILE *f = fopen("export/SkillCaps.txt", "w"); if(!f) { @@ -193,7 +193,7 @@ void ExportSkillCaps(SharedDatabase *db) { } void ExportBaseData(SharedDatabase *db) { - Log(Logs::General, Logs::Status, "Exporting Base Data..."); + LogInfo("Exporting Base Data"); FILE *f = fopen("export/BaseData.txt", "w"); if(!f) { @@ -224,7 +224,7 @@ void ExportBaseData(SharedDatabase *db) { } void ExportDBStrings(SharedDatabase *db) { - Log(Logs::General, Logs::Status, "Exporting DB Strings..."); + LogInfo("Exporting DB Strings"); FILE *f = fopen("export/dbstr_us.txt", "w"); if(!f) { diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index e52c53cd4..109ff4859 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -37,7 +37,7 @@ int main(int argc, char **argv) { LogSys.LoadLogSettingsDefaults(); set_exception_handler(); - Log(Logs::General, Logs::Status, "Client Files Import Utility"); + LogInfo("Client Files Import Utility"); if(!EQEmuConfig::LoadConfig()) { LogError("Unable to load configuration file."); return 1; @@ -46,7 +46,7 @@ int main(int argc, char **argv) { auto Config = EQEmuConfig::get(); SharedDatabase database; - Log(Logs::General, Logs::Status, "Connecting to database..."); + LogInfo("Connecting to database"); if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { LogError("Unable to connect to the database, cannot continue without a " @@ -97,7 +97,7 @@ bool IsStringField(int i) { } void ImportSpells(SharedDatabase *db) { - Log(Logs::General, Logs::Status, "Importing Spells..."); + LogInfo("Importing Spells"); FILE *f = fopen("import/spells_us.txt", "r"); if(!f) { LogError("Unable to open import/spells_us.txt to read, skipping."); @@ -173,19 +173,19 @@ void ImportSpells(SharedDatabase *db) { spells_imported++; if(spells_imported % 1000 == 0) { - Log(Logs::General, Logs::Status, "%d spells imported.", spells_imported); + LogInfo("[{}] spells imported", spells_imported); } } if(spells_imported % 1000 != 0) { - Log(Logs::General, Logs::Status, "%d spells imported.", spells_imported); + LogInfo("[{}] spells imported", spells_imported); } fclose(f); } void ImportSkillCaps(SharedDatabase *db) { - Log(Logs::General, Logs::Status, "Importing Skill Caps..."); + LogInfo("Importing Skill Caps"); FILE *f = fopen("import/SkillCaps.txt", "r"); if(!f) { @@ -220,7 +220,7 @@ void ImportSkillCaps(SharedDatabase *db) { } void ImportBaseData(SharedDatabase *db) { - Log(Logs::General, Logs::Status, "Importing Base Data..."); + LogInfo("Importing Base Data"); FILE *f = fopen("import/BaseData.txt", "r"); if(!f) { @@ -265,7 +265,7 @@ void ImportBaseData(SharedDatabase *db) { } void ImportDBStrings(SharedDatabase *db) { - Log(Logs::General, Logs::Status, "Importing DB Strings..."); + LogInfo("Importing DB Strings"); FILE *f = fopen("import/dbstr_us.txt", "r"); if(!f) { diff --git a/common/database.cpp b/common/database.cpp index 93594ba1d..84ac78144 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -68,7 +68,7 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c return false; } else { - Log(Logs::General, Logs::Status, "Using database '%s' at %s:%d", database, host,port); + LogInfo("Using database [{}] at [{}]:[{}]", database, host,port); return true; } } diff --git a/common/dbcore.cpp b/common/dbcore.cpp index 1189a8a62..2c46f298a 100644 --- a/common/dbcore.cpp +++ b/common/dbcore.cpp @@ -93,11 +93,11 @@ MySQLRequestResult DBcore::QueryDatabase(const char *query, uint32 querylen, boo if (errorNumber == CR_SERVER_LOST || errorNumber == CR_SERVER_GONE_ERROR) { if (retryOnFailureOnce) { - Log(Logs::General, Logs::Status, "Database Error: Lost connection, attempting to recover..."); + LogInfo("Database Error: Lost connection, attempting to recover"); MySQLRequestResult requestResult = QueryDatabase(query, querylen, false); if (requestResult.Success()) { - Log(Logs::General, Logs::Status, "Reconnection to database successful"); + LogInfo("Reconnection to database successful"); return requestResult; } diff --git a/common/eq_stream_ident.cpp b/common/eq_stream_ident.cpp index 58308384f..8222e471a 100644 --- a/common/eq_stream_ident.cpp +++ b/common/eq_stream_ident.cpp @@ -122,7 +122,7 @@ void EQStreamIdentifier::Process() { } case EQStreamInterface::MatchFailed: //do nothing... - LogNetcode("[StreamIdentify] [{}:{}]: Tried patch [{}] and it did not match", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()), p->name.c_str()); + LogNetcode("[StreamIdentify] [{}:{}] Tried patch [{}] and it did not match", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()), p->name.c_str()); break; } } diff --git a/queryserv/database.cpp b/queryserv/database.cpp index 25fb5996e..19f753241 100644 --- a/queryserv/database.cpp +++ b/queryserv/database.cpp @@ -76,7 +76,7 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c } else { - Log(Logs::General, Logs::Status, "Using database '%s' at %s:%d",database,host,port); + LogInfo("Using database [{}] at [{}]:[{}]",database,host,port); return true; } } diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index 45787a2b3..69b46d896 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -74,7 +74,7 @@ int main(int argc, char **argv) { LogSys.LoadLogSettingsDefaults(); set_exception_handler(); - Log(Logs::General, Logs::Status, "Shared Memory Loader Program"); + LogInfo("Shared Memory Loader Program"); if(!EQEmuConfig::LoadConfig()) { LogError("Unable to load configuration file"); return 1; @@ -83,7 +83,7 @@ int main(int argc, char **argv) { auto Config = EQEmuConfig::get(); SharedDatabase database; - Log(Logs::General, Logs::Status, "Connecting to database..."); + LogInfo("Connecting to database"); if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { LogError("Unable to connect to the database, cannot continue without a database connection"); @@ -96,7 +96,7 @@ int main(int argc, char **argv) { std::string shared_mem_directory = Config->SharedMemDir; if (MakeDirectory(shared_mem_directory)) { - Log(Logs::General, Logs::Status, "Shared Memory folder doesn't exist, so we created it... '%s'", shared_mem_directory.c_str()); + LogInfo("Shared Memory folder doesn't exist, so we created it [{}]", shared_mem_directory.c_str()); } database.LoadVariables(); @@ -105,7 +105,7 @@ int main(int argc, char **argv) { std::string db_hotfix_name; if (database.GetVariable("hotfix_name", db_hotfix_name)) { if (!db_hotfix_name.empty() && strcasecmp("hotfix_", db_hotfix_name.c_str()) == 0) { - Log(Logs::General, Logs::Status, "Current hotfix in variables is the default %s, clearing out variable", db_hotfix_name.c_str()); + LogInfo("Current hotfix in variables is the default [{}], clearing out variable", db_hotfix_name.c_str()); std::string query = StringFormat("UPDATE `variables` SET `value`='' WHERE (`varname`='hotfix_name')"); database.QueryDatabase(query); } @@ -176,11 +176,11 @@ int main(int argc, char **argv) { } if(hotfix_name.length() > 0) { - Log(Logs::General, Logs::Status, "Writing data for hotfix '%s'", hotfix_name.c_str()); + LogInfo("Writing data for hotfix [{}]", hotfix_name.c_str()); } if(load_all || load_items) { - Log(Logs::General, Logs::Status, "Loading items..."); + LogInfo("Loading items"); try { LoadItems(&database, hotfix_name); } catch(std::exception &ex) { @@ -190,7 +190,7 @@ int main(int argc, char **argv) { } if(load_all || load_factions) { - Log(Logs::General, Logs::Status, "Loading factions..."); + LogInfo("Loading factions"); try { LoadFactions(&database, hotfix_name); } catch(std::exception &ex) { @@ -200,7 +200,7 @@ int main(int argc, char **argv) { } if(load_all || load_loot) { - Log(Logs::General, Logs::Status, "Loading loot..."); + LogInfo("Loading loot"); try { LoadLoot(&database, hotfix_name); } catch(std::exception &ex) { @@ -210,7 +210,7 @@ int main(int argc, char **argv) { } if(load_all || load_skill_caps) { - Log(Logs::General, Logs::Status, "Loading skill caps..."); + LogInfo("Loading skill caps"); try { LoadSkillCaps(&database, hotfix_name); } catch(std::exception &ex) { @@ -220,7 +220,7 @@ int main(int argc, char **argv) { } if(load_all || load_spells) { - Log(Logs::General, Logs::Status, "Loading spells..."); + LogInfo("Loading spells"); try { LoadSpells(&database, hotfix_name); } catch(std::exception &ex) { @@ -230,7 +230,7 @@ int main(int argc, char **argv) { } if(load_all || load_bd) { - Log(Logs::General, Logs::Status, "Loading base data..."); + LogInfo("Loading base data"); try { LoadBaseData(&database, hotfix_name); } catch(std::exception &ex) { diff --git a/ucs/database.cpp b/ucs/database.cpp index 051bae211..b02b26eae 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -81,7 +81,7 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c } else { - Log(Logs::General, Logs::Status, "Using database '%s' at %s:%d",database,host,port); + LogInfo("Using database [{}] at [{}]:[{}]",database,host,port); return true; } } diff --git a/world/client.cpp b/world/client.cpp index b044f9f66..fc8388748 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -1342,7 +1342,7 @@ bool Client::GenPassKey(char* key) { } void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req) { - LogInfo("Sending EQApplicationPacket OpCode {:#04x}", app->GetOpcode()); + LogNetcode("Sending EQApplicationPacket OpCode {:#04x}", app->GetOpcode()); ack_req = true; // It's broke right now, dont delete this line till fix it. =P eqs->QueuePacket(app, ack_req); diff --git a/world/worlddb.cpp b/world/worlddb.cpp index 41b3c853d..fbd4cdf94 100644 --- a/world/worlddb.cpp +++ b/world/worlddb.cpp @@ -366,14 +366,14 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* return false; } - Log(Logs::General, Logs::Status, "SoF Start zone query: %s\n", query.c_str()); + LogInfo("SoF Start zone query: [{}]\n", query.c_str()); if (results.RowCount() == 0) { printf("No start_zones entry in database, using defaults\n"); isTitanium ? SetTitaniumDefaultStartZone(in_pp, in_cc) : SetSoFDefaultStartZone(in_pp, in_cc); } else { - Log(Logs::General, Logs::Status, "Found starting location in start_zones"); + LogInfo("Found starting location in start_zones"); auto row = results.begin(); in_pp->x = atof(row[0]); in_pp->y = atof(row[1]); diff --git a/zone/aa.cpp b/zone/aa.cpp index ce396c74a..b4977a5b9 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1562,17 +1562,17 @@ bool Mob::CanPurchaseAlternateAdvancementRank(AA::Rank *rank, bool check_price, } void Zone::LoadAlternateAdvancement() { - Log(Logs::General, Logs::Status, "Loading Alternate Advancement Data..."); + LogInfo("Loading Alternate Advancement Data"); if(!database.LoadAlternateAdvancementAbilities(aa_abilities, aa_ranks)) { aa_abilities.clear(); aa_ranks.clear(); - Log(Logs::General, Logs::Status, "Failed to load Alternate Advancement Data"); + LogInfo("Failed to load Alternate Advancement Data"); return; } - Log(Logs::General, Logs::Status, "Processing Alternate Advancement Data..."); + LogInfo("Processing Alternate Advancement Data"); for(const auto &ability : aa_abilities) { ability.second->first = GetAlternateAdvancementRank(ability.second->first_rank_id); @@ -1623,13 +1623,13 @@ void Zone::LoadAlternateAdvancement() { } } - Log(Logs::General, Logs::Status, "Loaded Alternate Advancement Data"); + LogInfo("Loaded Alternate Advancement Data"); } bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map> &abilities, std::unordered_map> &ranks) { - Log(Logs::General, Logs::Status, "Loading Alternate Advancement Abilities..."); + LogInfo("Loading Alternate Advancement Abilities"); abilities.clear(); std::string query = "SELECT id, name, category, classes, races, deities, drakkin_heritage, status, type, charges, " "grant_only, first_rank_id FROM aa_ability WHERE enabled = 1"; @@ -1659,9 +1659,9 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_mapoldname); - Log(Logs::General, Logs::Status, "GM(%s) changeing players name. Old:%s New:%s", GetName(), gmn->oldname, gmn->newname); + LogInfo("GM([{}]) changeing players name. Old:[{}] New:[{}]", GetName(), gmn->oldname, gmn->newname); bool usedname = database.CheckUsedName((const char*)gmn->newname); if (client == 0) { Message(Chat::Red, "%s not found for name change. Operation failed!", gmn->oldname); diff --git a/zone/doors.cpp b/zone/doors.cpp index d81eb72f8..f63300a22 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -679,7 +679,7 @@ int32 ZoneDatabase::GetDoorsDBCountPlusOne(const char *zone_name, int16 version) } bool ZoneDatabase::LoadDoors(int32 door_count, Door *into, const char *zone_name, int16 version) { - Log(Logs::General, Logs::Status, "Loading Doors from database..."); + LogInfo("Loading Doors from database"); std::string query = StringFormat( " SELECT " diff --git a/zone/embparser.cpp b/zone/embparser.cpp index 759fe5931..4ccb0747e 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -145,7 +145,7 @@ void PerlembParser::ReloadQuests() { perl = nullptr; } - Log(Logs::General, Logs::Status, "Error re-initializing perlembed: %s", e.what()); + LogInfo("Error re-initializing perlembed: [{}]", e.what()); throw e.what(); } diff --git a/zone/map.cpp b/zone/map.cpp index a63ea6672..3ce98f864 100644 --- a/zone/map.cpp +++ b/zone/map.cpp @@ -223,7 +223,7 @@ Map *Map::LoadMapFile(std::string file) { filename += file; filename += ".map"; - Log(Logs::General, Logs::Status, "Attempting to load Map File '%s'", filename.c_str()); + LogInfo("Attempting to load Map File [{}]", filename.c_str()); auto m = new Map(); if (m->Load(filename)) { @@ -238,7 +238,7 @@ Map *Map::LoadMapFile(std::string file) { bool Map::Load(std::string filename, bool force_mmf_overwrite) { if (LoadMMF(filename, force_mmf_overwrite)) { - Log(Logs::General, Logs::Status, "Loaded .MMF Map File in place of '%s'", filename.c_str()); + LogInfo("Loaded .MMF Map File in place of [{}]", filename.c_str()); return true; } #else @@ -255,7 +255,7 @@ bool Map::Load(std::string filename) } if(version == 0x01000000) { - Log(Logs::General, Logs::Status, "Loaded V1 Map File '%s'", filename.c_str()); + LogInfo("Loaded V1 Map File [{}]", filename.c_str()); bool v = LoadV1(f); fclose(f); @@ -266,7 +266,7 @@ bool Map::Load(std::string filename) return v; } else if(version == 0x02000000) { - Log(Logs::General, Logs::Status, "Loaded V2 Map File '%s'", filename.c_str()); + LogInfo("Loaded V2 Map File [{}]", filename.c_str()); bool v = LoadV2(f); fclose(f); diff --git a/zone/pathfinder_nav_mesh.cpp b/zone/pathfinder_nav_mesh.cpp index 262d7a923..5be10b64f 100644 --- a/zone/pathfinder_nav_mesh.cpp +++ b/zone/pathfinder_nav_mesh.cpp @@ -475,7 +475,7 @@ void PathfinderNavmesh::Load(const std::string &path) m_impl->nav_mesh->addTile(data, data_size, DT_TILE_FREE_DATA, tile_ref, 0); } - Log(Logs::General, Logs::Status, "Loaded Navmesh V%u file %s", version, path.c_str()); + LogInfo("Loaded Navmesh V[{}] file [{}]", version, path.c_str()); } } diff --git a/zone/pathing.cpp b/zone/pathing.cpp index e579bd0fe..ee5f0138a 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -30,7 +30,7 @@ void CullPoints(std::vector &points) { if (zone->zonemap->CheckLoS(glm::vec3(p.x, p.y, p.z), glm::vec3(p2.x, p2.y, p2.z))) { points.erase(points.begin() + i + 1); - Log(Logs::General, Logs::Status, "Culled find path point %u, connecting %u->%u instead.", i + 1, i, i + 2); + LogInfo("Culled find path point [{}], connecting [{}]->[{}] instead", i + 1, i, i + 2); } else { break; diff --git a/zone/water_map.cpp b/zone/water_map.cpp index 9c51e3056..3d8871aea 100644 --- a/zone/water_map.cpp +++ b/zone/water_map.cpp @@ -45,7 +45,7 @@ WaterMap* WaterMap::LoadWaterMapfile(std::string zone_name) { wm = nullptr; } - Log(Logs::General, Logs::Status, "Loaded Water Map V%u file %s", version, file_path.c_str()); + LogInfo("Loaded Water Map V[{}] file [{}]", version, file_path.c_str()); fclose(f); return wm; @@ -56,7 +56,7 @@ WaterMap* WaterMap::LoadWaterMapfile(std::string zone_name) { wm = nullptr; } - Log(Logs::General, Logs::Status, "Loaded Water Map V%u file %s", version, file_path.c_str()); + LogInfo("Loaded Water Map V[{}] file [{}]", version, file_path.c_str()); fclose(f); return wm; diff --git a/zone/zone.cpp b/zone/zone.cpp index 5d154b6a4..381d3fd4f 100755 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -92,7 +92,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { return false; } - Log(Logs::General, Logs::Status, "Booting %s (%d:%d)", zonename, iZoneID, iInstanceID); + LogInfo("Booting [{}] ([{}]:[{}])", zonename, iZoneID, iInstanceID); numclients = 0; zone = new Zone(iZoneID, iInstanceID, zonename); @@ -117,13 +117,13 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { log_levels[i]=0; //set to zero on a bogue char } zone->loglevelvar = log_levels[0]; - Log(Logs::General, Logs::Status, "General logging level: %i", zone->loglevelvar); + LogInfo("General logging level: [{}]", zone->loglevelvar); zone->merchantvar = log_levels[1]; - Log(Logs::General, Logs::Status, "Merchant logging level: %i", zone->merchantvar); + LogInfo("Merchant logging level: [{}]", zone->merchantvar); zone->tradevar = log_levels[2]; - Log(Logs::General, Logs::Status, "Trade logging level: %i", zone->tradevar); + LogInfo("Trade logging level: [{}]", zone->tradevar); zone->lootvar = log_levels[3]; - Log(Logs::General, Logs::Status, "Loot logging level: %i", zone->lootvar); + LogInfo("Loot logging level: [{}]", zone->lootvar); } else { zone->loglevelvar = uint8(tmp_i); //continue supporting only command logging (for now) @@ -145,7 +145,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { } Log(Logs::General, Logs::Normal, "---- Zone server %s, listening on port:%i ----", zonename, ZoneConfig::get()->ZonePort); - Log(Logs::General, Logs::Status, "Zone Bootup: %s (%i: %i)", zonename, iZoneID, iInstanceID); + LogInfo("Zone Bootup: [{}] ([{}]: [{}])", zonename, iZoneID, iInstanceID); parse->Init(); UpdateWindowTitle(); zone->GetTimeSync(); @@ -181,7 +181,7 @@ bool Zone::LoadZoneObjects() return false; } - Log(Logs::General, Logs::Status, "Loading Objects from DB..."); + LogInfo("Loading Objects from DB"); for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[9]) == 0) { // Type == 0 - Static Object @@ -300,7 +300,7 @@ bool Zone::LoadGroundSpawns() { memset(&groundspawn, 0, sizeof(groundspawn)); int gsindex=0; - Log(Logs::General, Logs::Status, "Loading Ground Spawns from DB..."); + LogInfo("Loading Ground Spawns from DB"); database.LoadGroundSpawns(zoneid, GetInstanceVersion(), &groundspawn); uint32 ix=0; char* name = nullptr; @@ -419,7 +419,7 @@ uint32 Zone::GetTempMerchantQuantity(uint32 NPCID, uint32 Slot) { } void Zone::LoadTempMerchantData() { - Log(Logs::General, Logs::Status, "Loading Temporary Merchant Lists..."); + LogInfo("Loading Temporary Merchant Lists"); std::string query = StringFormat( "SELECT " "DISTINCT ml.npcid, " @@ -489,7 +489,7 @@ void Zone::LoadNewMerchantData(uint32 merchantid) { } void Zone::GetMerchantDataForZoneLoad() { - Log(Logs::General, Logs::Status, "Loading Merchant Lists..."); + LogInfo("Loading Merchant Lists"); std::string query = StringFormat( "SELECT " "DISTINCT ml.merchantid, " @@ -714,7 +714,7 @@ void Zone::Shutdown(bool quite) } zone->ldon_trap_entry_list.clear(); - Log(Logs::General, Logs::Status, "Zone Shutdown: %s (%i)", zone->GetShortName(), zone->GetZoneID()); + LogInfo("Zone Shutdown: [{}] ([{}])", zone->GetShortName(), zone->GetZoneID()); petition_list.ClearPetitions(); zone->SetZoneHasCurrentTime(false); if (!quite) @@ -732,19 +732,19 @@ void Zone::Shutdown(bool quite) void Zone::LoadZoneDoors(const char* zone, int16 version) { - Log(Logs::General, Logs::Status, "Loading doors for %s ...", zone); + LogInfo("Loading doors for [{}] ", zone); uint32 maxid; int32 count = database.GetDoorsCount(&maxid, zone, version); if(count < 1) { - Log(Logs::General, Logs::Status, "... No doors loaded."); + LogInfo("No doors loaded"); return; } auto dlist = new Door[count]; if(!database.LoadDoors(count, dlist, zone, version)) { - LogError(" Failed to load doors"); + LogError("Failed to load doors"); delete[] dlist; return; } @@ -915,59 +915,59 @@ bool Zone::Init(bool iStaticZone) { zone->watermap = WaterMap::LoadWaterMapfile(zone->map_name); zone->pathing = IPathfinder::Load(zone->map_name); - Log(Logs::General, Logs::Status, "Loading spawn conditions..."); + LogInfo("Loading spawn conditions"); if(!spawn_conditions.LoadSpawnConditions(short_name, instanceid)) { LogError("Loading spawn conditions failed, continuing without them"); } - Log(Logs::General, Logs::Status, "Loading static zone points..."); + LogInfo("Loading static zone points"); if (!database.LoadStaticZonePoints(&zone_point_list, short_name, GetInstanceVersion())) { LogError("Loading static zone points failed"); return false; } - Log(Logs::General, Logs::Status, "Loading spawn groups..."); + LogInfo("Loading spawn groups"); if (!database.LoadSpawnGroups(short_name, GetInstanceVersion(), &spawn_group_list)) { LogError("Loading spawn groups failed"); return false; } - Log(Logs::General, Logs::Status, "Loading spawn2 points..."); + LogInfo("Loading spawn2 points"); if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion())) { LogError("Loading spawn2 points failed"); return false; } - Log(Logs::General, Logs::Status, "Loading player corpses..."); + LogInfo("Loading player corpses"); if (!database.LoadCharacterCorpses(zoneid, instanceid)) { LogError("Loading player corpses failed"); return false; } - Log(Logs::General, Logs::Status, "Loading traps..."); + LogInfo("Loading traps"); if (!database.LoadTraps(short_name, GetInstanceVersion())) { LogError("Loading traps failed"); return false; } - Log(Logs::General, Logs::Status, "Loading adventure flavor text..."); + LogInfo("Loading adventure flavor text"); LoadAdventureFlavor(); - Log(Logs::General, Logs::Status, "Loading ground spawns..."); + LogInfo("Loading ground spawns"); if (!LoadGroundSpawns()) { LogError("Loading ground spawns failed. continuing"); } - Log(Logs::General, Logs::Status, "Loading World Objects from DB..."); + LogInfo("Loading World Objects from DB"); if (!LoadZoneObjects()) { LogError("Loading World Objects failed. continuing"); } - Log(Logs::General, Logs::Status, "Flushing old respawn timers..."); + LogInfo("Flushing old respawn timers"); database.QueryDatabase("DELETE FROM `respawn_times` WHERE (`start` + `duration`) < UNIX_TIMESTAMP(NOW())"); //load up the zone's doors (prints inside) @@ -1008,10 +1008,10 @@ bool Zone::Init(bool iStaticZone) { petition_list.ClearPetitions(); petition_list.ReadDatabase(); - Log(Logs::General, Logs::Status, "Loading timezone data..."); + LogInfo("Loading timezone data"); zone->zone_time.setEQTimeZone(database.GetZoneTZ(zoneid, GetInstanceVersion())); - Log(Logs::General, Logs::Status, "Init Finished: ZoneID = %d, Time Offset = %d", zoneid, zone->zone_time.getEQTimeZone()); + LogInfo("Init Finished: ZoneID = [{}], Time Offset = [{}]", zoneid, zone->zone_time.getEQTimeZone()); LoadTickItems(); @@ -1022,29 +1022,29 @@ bool Zone::Init(bool iStaticZone) { } void Zone::ReloadStaticData() { - Log(Logs::General, Logs::Status, "Reloading Zone Static Data..."); + LogInfo("Reloading Zone Static Data"); - Log(Logs::General, Logs::Status, "Reloading static zone points..."); + LogInfo("Reloading static zone points"); zone_point_list.Clear(); if (!database.LoadStaticZonePoints(&zone_point_list, GetShortName(), GetInstanceVersion())) { LogError("Loading static zone points failed"); } - Log(Logs::General, Logs::Status, "Reloading traps..."); + LogInfo("Reloading traps"); entity_list.RemoveAllTraps(); if (!database.LoadTraps(GetShortName(), GetInstanceVersion())) { LogError("Reloading traps failed"); } - Log(Logs::General, Logs::Status, "Reloading ground spawns..."); + LogInfo("Reloading ground spawns"); if (!LoadGroundSpawns()) { LogError("Reloading ground spawns failed. continuing"); } entity_list.RemoveAllObjects(); - Log(Logs::General, Logs::Status, "Reloading World Objects from DB..."); + LogInfo("Reloading World Objects from DB"); if (!LoadZoneObjects()) { LogError("Reloading World Objects failed. continuing"); @@ -1063,7 +1063,7 @@ void Zone::ReloadStaticData() { if (!LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion())) // try loading the zone name... LoadZoneCFG(zone->GetFileName(), zone->GetInstanceVersion()); // if that fails, try the file name, then load defaults - Log(Logs::General, Logs::Status, "Zone Static Data Reloaded."); + LogInfo("Zone Static Data Reloaded"); } bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id) @@ -1093,7 +1093,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id) strcpy(newzone_data.zone_long_name, GetLongName()); strcpy(newzone_data.zone_short_name2, GetShortName()); - Log(Logs::General, Logs::Status, "Successfully loaded Zone Config."); + LogInfo("Successfully loaded Zone Config"); return true; } @@ -1668,8 +1668,8 @@ ZonePoint* Zone::GetClosestZonePoint(const glm::vec3& location, uint32 to, Clien if ((zone->HasWaterMap() && !zone->watermap->InZoneLine(glm::vec3(client->GetPosition()))) || (!zone->HasWaterMap() && closest_dist > 400.0f && closest_dist < max_distance2)) { //TODO cheat detection - Log(Logs::General, Logs::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.", to, closest_dist); - Log(Logs::General, Logs::Status, ". %s", to_string(location).c_str()); + LogInfo("WARNING: Closest zone point for zone id [{}] is %f, you might need to update your zone_points table if you dont arrive at the right spot", to, closest_dist); + LogInfo(". [{}]", to_string(location).c_str()); } if(closest_dist > max_distance2) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 9780ea4cb..7c02f31a7 100755 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -3461,7 +3461,7 @@ int32 ZoneDatabase::GetBlockedSpellsCount(uint32 zoneid) bool ZoneDatabase::LoadBlockedSpells(int32 blockedSpellsCount, ZoneSpellsBlocked* into, uint32 zoneid) { - Log(Logs::General, Logs::Status, "Loading Blocked Spells from database..."); + LogInfo("Loading Blocked Spells from database"); std::string query = StringFormat("SELECT id, spellid, type, x, y, z, x_diff, y_diff, z_diff, message " "FROM blocked_spells WHERE zoneid = %d ORDER BY id ASC", zoneid); diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 9a9d7889a..d69664b90 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -348,7 +348,7 @@ void Client::DoZoneSuccess(ZoneChange_Struct *zc, uint16 zone_id, uint32 instanc if(this->GetPet()) entity_list.RemoveFromHateLists(this->GetPet()); - Log(Logs::General, Logs::Status, "Zoning '%s' to: %s (%i) - (%i) x=%f, y=%f, z=%f", m_pp.name, database.GetZoneName(zone_id), zone_id, instance_id, dest_x, dest_y, dest_z); + LogInfo("Zoning [{}] to: [{}] ([{}]) - ([{}]) x=%f, y=%f, z=%f", m_pp.name, database.GetZoneName(zone_id), zone_id, instance_id, dest_x, dest_y, dest_z); //set the player's coordinates in the new zone so they have them //when they zone into it