diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 3fa855b3b..8192b9327 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -55,7 +55,7 @@ std::ofstream process_log; */ EQEmuLogSys::EQEmuLogSys() { - m_on_log_gmsay_hook = [](uint16 log_type, const std::string &) {}; + m_on_log_gmsay_hook = [](uint16 log_type, const char *func, const std::string &) {}; m_on_log_console_hook = [](uint16 log_type, const std::string &) {}; } @@ -412,7 +412,7 @@ void EQEmuLogSys::Out( ); } if (l.log_to_gmsay_enabled) { - m_on_log_gmsay_hook(log_category, output_message); + m_on_log_gmsay_hook(log_category, func, output_message); } if (l.log_to_file_enabled) { EQEmuLogSys::ProcessLogWrite( diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index f081bd86d..0c8ec1ae3 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -344,7 +344,7 @@ public: // gmsay uint16 GetGMSayColorFromCategory(uint16 log_category); - EQEmuLogSys *SetGMSayHandler(std::function f) + EQEmuLogSys *SetGMSayHandler(const std::function& f) { m_on_log_gmsay_hook = f; return this; @@ -375,15 +375,15 @@ public: private: // reference to database - Database *m_database; - std::function m_on_log_gmsay_hook; - std::function m_on_log_discord_hook; - std::function m_on_log_console_hook; - DiscordWebhooks m_discord_webhooks[MAX_DISCORD_WEBHOOK_ID]{}; - bool m_file_logs_enabled = false; - int m_log_platform = 0; - std::string m_platform_file_name; - std::string m_log_path; + Database *m_database; + std::function m_on_log_gmsay_hook; + std::function m_on_log_discord_hook; + std::function m_on_log_console_hook; + DiscordWebhooks m_discord_webhooks[MAX_DISCORD_WEBHOOK_ID]{}; + bool m_file_logs_enabled = false; + int m_log_platform = 0; + std::string m_platform_file_name; + std::string m_log_path; void ProcessConsoleMessage( uint16 log_category, diff --git a/world/world_boot.cpp b/world/world_boot.cpp index 472b18fef..42937057b 100644 --- a/world/world_boot.cpp +++ b/world/world_boot.cpp @@ -30,7 +30,7 @@ extern ZSList zoneserver_list; extern WorldConfig Config; -void WorldBoot::GMSayHookCallBackProcessWorld(uint16 log_category, std::string message) +void WorldBoot::GMSayHookCallBackProcessWorld(uint16 log_category, const char *func, std::string message) { // we don't want to loop up with chat messages if (message.find("OP_SpecialMesg") != std::string::npos) { @@ -71,7 +71,7 @@ void WorldBoot::GMSayHookCallBackProcessWorld(uint16 log_category, std::string m AccountStatus::QuestTroupe, LogSys.GetGMSayColorFromCategory(log_category), "%s", - message.c_str() + fmt::format("[{}] [{}] {}", Logs::LogCategoryName[log_category], func, message).c_str() ); } diff --git a/world/world_boot.h b/world/world_boot.h index 80afb6370..9e6f9b655 100644 --- a/world/world_boot.h +++ b/world/world_boot.h @@ -6,7 +6,7 @@ class WorldBoot { public: - static void GMSayHookCallBackProcessWorld(uint16 log_category, std::string message); + static void GMSayHookCallBackProcessWorld(uint16 log_category, const char *func, std::string message); static bool HandleCommandInput(int argc, char **argv); static bool LoadServerConfig(); static bool LoadDatabaseConnections(); diff --git a/zone/zone.h b/zone/zone.h index 28b302cf0..3d404397c 100755 --- a/zone/zone.h +++ b/zone/zone.h @@ -327,7 +327,7 @@ public: * @param log_category * @param message */ - static void GMSayHookCallBackProcess(uint16 log_category, std::string message) + static void GMSayHookCallBackProcess(uint16 log_category, const char *func, std::string message) { // we don't want to loop up with chat messages if (message.find("OP_SpecialMesg") != std::string::npos) { @@ -372,7 +372,7 @@ public: 0, AccountStatus::QuestTroupe, LogSys.GetGMSayColorFromCategory(log_category), - message.c_str() + fmt::format("[{}] [{}] {}", Logs::LogCategoryName[log_category], func, message).c_str() ); } }