feat(Core/Logging): rework logging (#4692)

* feat(Core/Logging): rework logging

* correct level for sql.sql

* del unused config options

* Correct build

* correct after merge

* whitespace

20:29:37 1. 'Player.cpp'. Replace (1)
20:29:37 2. 'ObjectMgr.cpp'. Replace (3)

* 1

* correct logging

* correct affter merge

* 1

* 2

* LOG_LEVEL_WARN

* #include "AppenderDB.h"

* 3

* 4

* 5

* 1. 'WorldSocket.cpp'. Replace (1)

* 6

* 1
This commit is contained in:
Kargatum
2021-04-17 16:20:07 +07:00
committed by GitHub
parent b2861be1cd
commit 4af4cbd3d9
246 changed files with 7413 additions and 6807 deletions

View File

@@ -0,0 +1,39 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
* Copyright (C) 2008-2021 TrinityCore <http://www.trinitycore.org/>
*/
#ifndef LogMessage_h__
#define LogMessage_h__
#include "Define.h"
#include "LogCommon.h"
#include <string>
#include <ctime>
struct LogMessage
{
LogMessage(LogLevel _level, std::string const& _type, std::string&& _text);
LogMessage(LogLevel _level, std::string const& _type, std::string&& _text, std::string&& _param1);
LogMessage(LogMessage const& /*other*/) = delete;
LogMessage& operator=(LogMessage const& /*other*/) = delete;
static std::string getTimeStr(time_t time);
std::string getTimeStr() const;
LogLevel const level;
std::string const type;
std::string const text;
std::string prefix;
std::string param1;
time_t mtime;
///@ Returns size of the log message content in bytes
uint32 Size() const
{
return static_cast<uint32>(prefix.size() + text.size());
}
};
#endif // LogMessage_h__