fix (core/logging/conf): Fix Logging for Modules (#11601)

* fix (core/logging/conf): Fix Logging for Modules

Fix custom module logging and appender. Also included Logging Async Conf.

* Update Log.cpp

* Core/Logging: Force synchronous logging after io_service shutdown - fixes logging on worldserver shutdown

https: //github.com/TrinityCore/TrinityCore/commit/c71987b1a1403fa20654cc24b37448ca807ff363
Co-Authored-By: Shauren <shauren.trinity@gmail.com>

Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
acidmanifesto
2022-05-19 09:54:08 -04:00
committed by GitHub
parent c5368816fa
commit 76d57065e2
7 changed files with 58 additions and 12 deletions
+10 -1
View File
@@ -29,6 +29,12 @@ class Appender;
class Logger;
struct LogMessage;
namespace Acore::Asio
{
class IoContext;
class Strand;
}
#define LOGGER_ROOT "root"
typedef Appender*(*AppenderCreatorFn)(uint8 id, std::string const& name, LogLevel level, AppenderFlags flags, std::vector<std::string_view> const& extraArgs);
@@ -54,7 +60,8 @@ private:
public:
static Log* instance();
void Initialize();
void Initialize(Acore::Asio::IoContext* ioContext);
void SetSynchronous(); // Not threadsafe - should only be called from main() after all threads are joined
void LoadFromConfig();
void Close();
[[nodiscard]] bool ShouldLog(std::string const& type, LogLevel level) const;
@@ -112,6 +119,8 @@ private:
std::string m_logsDir;
std::string m_logsTimestamp;
Acore::Asio::IoContext* _ioContext;
Acore::Asio::Strand* _strand;
// Deprecated debug filter logs
DebugLogFilters _debugLogMask;
};