From 4af5f79328a0e2113b22420d8e3de8373983df80 Mon Sep 17 00:00:00 2001 From: hg <4683435+hgtw@users.noreply.github.com> Date: Sun, 14 Jun 2020 17:16:03 -0400 Subject: [PATCH] Remove logging of expedition query failures This is redundant with sql error logging. Logging the operations is enough to determine the source of any errors --- world/expedition.cpp | 32 +++++++---------- zone/dynamiczone.cpp | 8 ++--- zone/expedition_database.cpp | 69 ++++++------------------------------ 3 files changed, 26 insertions(+), 83 deletions(-) diff --git a/world/expedition.cpp b/world/expedition.cpp index eecd91559..74cea7c36 100644 --- a/world/expedition.cpp +++ b/world/expedition.cpp @@ -205,6 +205,8 @@ void ExpeditionCache::Process() void ExpeditionDatabase::PurgeExpiredExpeditions() { + LogExpeditionsDetail("Purging expired expeditions"); + std::string query = SQL( DELETE expedition FROM expedition_details expedition LEFT JOIN instance_list ON expedition.instance_id = instance_list.id @@ -220,29 +222,25 @@ void ExpeditionDatabase::PurgeExpiredExpeditions() OR (instance_list.start_time + instance_list.duration) <= UNIX_TIMESTAMP(); ); - auto results = database.QueryDatabase(query); - if (!results.Success()) - { - LogExpeditions("Failed to purge expired and empty expeditions"); - } + database.QueryDatabase(query); } void ExpeditionDatabase::PurgeExpiredCharacterLockouts() { + LogExpeditionsDetail("Purging expired lockouts"); + std::string query = SQL( DELETE FROM expedition_character_lockouts WHERE expire_time <= NOW(); ); - auto results = database.QueryDatabase(query); - if (!results.Success()) - { - LogExpeditions("Failed to purge expired lockouts"); - } + database.QueryDatabase(query); } std::vector ExpeditionDatabase::LoadExpeditions() { + LogExpeditionsDetail("Loading expeditions for world cache"); + std::vector expeditions; std::string query = SQL( @@ -262,11 +260,7 @@ std::vector ExpeditionDatabase::LoadExpeditions() ); auto results = database.QueryDatabase(query); - if (!results.Success()) - { - LogExpeditions("Failed to load expeditions for world cache"); - } - else + if (results.Success()) { uint32_t last_expedition_id = 0; @@ -297,6 +291,8 @@ std::vector ExpeditionDatabase::LoadExpeditions() Expedition ExpeditionDatabase::LoadExpedition(uint32_t expedition_id) { + LogExpeditions("Loading expedition [{}] for world cache", expedition_id); + Expedition expedition; std::string query = fmt::format(SQL( @@ -316,11 +312,7 @@ Expedition ExpeditionDatabase::LoadExpedition(uint32_t expedition_id) ), expedition_id); auto results = database.QueryDatabase(query); - if (!results.Success()) - { - LogExpeditions("Failed to load expedition [{}] for world cache", expedition_id); - } - else + if (results.Success()) { bool created = false; for (auto row = results.begin(); row != results.end(); ++row) diff --git a/zone/dynamiczone.cpp b/zone/dynamiczone.cpp index 65f92e321..afa5fc7b7 100644 --- a/zone/dynamiczone.cpp +++ b/zone/dynamiczone.cpp @@ -429,6 +429,8 @@ void DynamicZone::RemoveAllCharacters(bool enable_removal_timers) void DynamicZone::SaveInstanceMembersToDatabase(const std::unordered_set& character_ids) { + LogDynamicZonesDetail("Saving [{}] instance members to database", character_ids.size()); + std::string insert_values; for (const auto& character_id : character_ids) { @@ -443,11 +445,7 @@ void DynamicZone::SaveInstanceMembersToDatabase(const std::unordered_set