[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
This commit is contained in:
Chris Miles 2023-02-18 05:41:14 -06:00 committed by GitHub
parent 999fe10d86
commit b5a2713a3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View File

@ -136,6 +136,7 @@ namespace Logs {
PacketServerToServer, PacketServerToServer,
Bugs, Bugs,
QuestErrors, QuestErrors,
PlayerEvents,
MaxCategoryID /* Don't Remove this */ MaxCategoryID /* Don't Remove this */
}; };
@ -230,7 +231,8 @@ namespace Logs {
"Packet C->S", "Packet C->S",
"Packet S->S", "Packet S->S",
"Bugs", "Bugs",
"QuestErrors" "QuestErrors",
"PlayerEvents",
}; };
} }

View File

@ -784,6 +784,16 @@
OutF(LogSys, Logs::Detail, Logs::QuestErrors, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(LogSys, Logs::Detail, Logs::QuestErrors, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } 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 {\ #define Log(debug_level, log_category, message, ...) do {\
if (LogSys.IsLogEnabled(debug_level, log_category))\ if (LogSys.IsLogEnabled(debug_level, log_category))\
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\

View File

@ -121,7 +121,7 @@ void PlayerEventLogs::ProcessBatchQueue()
// flush many // flush many
PlayerEventLogsRepository::InsertMany(*m_database, m_record_batch_queue); PlayerEventLogsRepository::InsertMany(*m_database, m_record_batch_queue);
LogInfo( LogPlayerEventsDetail(
"Processing batch player event log queue of [{}] took [{}]", "Processing batch player event log queue of [{}] took [{}]",
m_record_batch_queue.size(), m_record_batch_queue.size(),
benchmark.elapsed() benchmark.elapsed()