From b5a2713a3a0610c057db3cd6f67e463a17b04f6d Mon Sep 17 00:00:00 2001 From: Chris Miles Date: Sat, 18 Feb 2023 05:41:14 -0600 Subject: [PATCH] [Player Events] Add logging category to hold processing batch logs (#2954) * [Player Events] Add logging category to hold processing batch logs * Update player_event_logs.cpp --- common/eqemu_logsys.h | 4 +++- common/eqemu_logsys_log_aliases.h | 10 ++++++++++ common/events/player_event_logs.cpp | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 0c8ec1ae3e..bea481a293 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -136,6 +136,7 @@ namespace Logs { PacketServerToServer, Bugs, QuestErrors, + PlayerEvents, MaxCategoryID /* Don't Remove this */ }; @@ -230,7 +231,8 @@ namespace Logs { "Packet C->S", "Packet S->S", "Bugs", - "QuestErrors" + "QuestErrors", + "PlayerEvents", }; } diff --git a/common/eqemu_logsys_log_aliases.h b/common/eqemu_logsys_log_aliases.h index 4db8b6edc4..3b4c0960dc 100644 --- a/common/eqemu_logsys_log_aliases.h +++ b/common/eqemu_logsys_log_aliases.h @@ -784,6 +784,16 @@ OutF(LogSys, Logs::Detail, Logs::QuestErrors, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ } while (0) +#define LogPlayerEvents(message, ...) do {\ + if (LogSys.IsLogEnabled(Logs::General, Logs::PlayerEvents))\ + OutF(LogSys, Logs::General, Logs::PlayerEvents, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ +} while (0) + +#define LogPlayerEventsDetail(message, ...) do {\ + if (LogSys.IsLogEnabled(Logs::Detail, Logs::PlayerEvents))\ + OutF(LogSys, Logs::Detail, Logs::PlayerEvents, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ +} while (0) + #define Log(debug_level, log_category, message, ...) do {\ if (LogSys.IsLogEnabled(debug_level, log_category))\ LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ diff --git a/common/events/player_event_logs.cpp b/common/events/player_event_logs.cpp index 0d0ecf287a..ec4e989831 100644 --- a/common/events/player_event_logs.cpp +++ b/common/events/player_event_logs.cpp @@ -121,7 +121,7 @@ void PlayerEventLogs::ProcessBatchQueue() // flush many PlayerEventLogsRepository::InsertMany(*m_database, m_record_batch_queue); - LogInfo( + LogPlayerEventsDetail( "Processing batch player event log queue of [{}] took [{}]", m_record_batch_queue.size(), benchmark.elapsed()