Skip to content

Commit

Permalink
[Player Events] Add logging category to hold processing batch logs (#…
Browse files Browse the repository at this point in the history
…2954)

* [Player Events] Add logging category to hold processing batch logs

* Update player_event_logs.cpp
  • Loading branch information
Akkadius authored Feb 18, 2023
1 parent 999fe10 commit b5a2713
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion common/eqemu_logsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ namespace Logs {
PacketServerToServer,
Bugs,
QuestErrors,
PlayerEvents,
MaxCategoryID /* Don't Remove this */
};

Expand Down Expand Up @@ -230,7 +231,8 @@ namespace Logs {
"Packet C->S",
"Packet S->S",
"Bugs",
"QuestErrors"
"QuestErrors",
"PlayerEvents",
};
}

Expand Down
10 changes: 10 additions & 0 deletions common/eqemu_logsys_log_aliases.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__);\
Expand Down
2 changes: 1 addition & 1 deletion common/events/player_event_logs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b5a2713

Please sign in to comment.