fix (core): server.log dump (#10742)

This commit is contained in:
acidmanifesto
2022-02-22 12:53:22 -05:00
committed by GitHub
parent 1d6788b22d
commit 7435805860
3 changed files with 0 additions and 29 deletions

View File

@@ -314,21 +314,6 @@ bool Log::SetLogLevel(std::string const& name, int32 newLeveli, bool isLogger /*
return true;
}
void Log::outCharDump(std::string_view str, uint32 accountId, uint64 guid, std::string_view name)
{
if (str.empty() || !ShouldLog("entities.player.dump", LOG_LEVEL_INFO))
{
return;
}
std::string message = Acore::StringFormatFmt("== START DUMP == (account: {} guid: {} name: {})\n {} \n== END DUMP ==\n", accountId, guid, name, str);
std::unique_ptr<LogMessage> msg(new LogMessage(LOG_LEVEL_INFO, "entities.player.dump", message));
msg->param1 = Acore::StringFormatFmt("{}_{}", guid, name);
write(std::move(msg));
}
void Log::SetRealmId(uint32 id)
{
for (std::pair<uint8 const, std::unique_ptr<Appender>>& appender : appenders)

View File

@@ -77,8 +77,6 @@ public:
_outCommand(Acore::StringFormatFmt(fmt, std::forward<Args>(args)...), std::to_string(account));
}
void outCharDump(std::string_view str, uint32 account_id, uint64 guid, std::string_view name);
void SetRealmId(uint32 id);
template<class AppenderImpl>
@@ -168,9 +166,6 @@ private:
#define LOG_TRACE(filterType__, ...) \
LOG_MESSAGE_BODY(filterType__, LogLevel::LOG_LEVEL_TRACE, __VA_ARGS__)
#define LOG_CHAR_DUMP(message__, accountId__, guid__, name__) \
sLog->outCharDump(message__, accountId__, guid__, name__)
#define LOG_GM(accountId__, ...) \
sLog->outCommand(accountId__, __VA_ARGS__)

View File

@@ -654,15 +654,6 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket& recvData)
// To prevent hook failure, place hook before removing reference from DB
sScriptMgr->OnPlayerDelete(guid, initAccountId); // To prevent race conditioning, but as it also makes sense, we hand the accountId over for successful delete.
// Shouldn't interfere with character deletion though
if (sLog->ShouldLog("entities.player.dump", LogLevel::LOG_LEVEL_INFO)) // optimize GetPlayerDump call
{
std::string dump;
if (PlayerDumpWriter().GetDump(guid.GetCounter(), dump))
LOG_CHAR_DUMP(dump, accountId, guid.GetRawValue(), name);
}
sCalendarMgr->RemoveAllPlayerEventsAndInvites(guid);
Player::DeleteFromDB(guid.GetCounter(), GetAccountId(), true, false);