mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Logging: Removed one layer of allocations from log message writes (async doesn't wrap in shared_ptr anymore and sync creates LogMessage on the stack)
This commit is contained in:
@@ -16,19 +16,16 @@
|
||||
*/
|
||||
|
||||
#include "LogOperation.h"
|
||||
#include "Logger.h"
|
||||
#include "LogMessage.h"
|
||||
#include "Logger.h"
|
||||
|
||||
LogOperation::LogOperation(Logger const* _logger, std::unique_ptr<LogMessage>&& _msg) : logger(_logger), msg(std::forward<std::unique_ptr<LogMessage>>(_msg))
|
||||
LogOperation::LogOperation(Logger const* _logger, LogMessage* _msg) : logger(_logger), msg(_msg)
|
||||
{
|
||||
}
|
||||
|
||||
LogOperation::~LogOperation()
|
||||
{
|
||||
}
|
||||
LogOperation::~LogOperation() = default;
|
||||
|
||||
int LogOperation::call()
|
||||
void LogOperation::operator()() const
|
||||
{
|
||||
logger->write(msg.get());
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user