Files
TG_ARPG/Plugins/Developer/RiderLink/Source/RiderLogging/Private/RiderOutputDevice.cpp
2023-07-16 14:29:40 +08:00

27 lines
828 B
C++

#include "RiderOutputDevice.hpp"
#include "CoreGlobals.h"
#include "Misc/OutputDeviceRedirector.h"
FRiderOutputDevice::FRiderOutputDevice() {
GLog->AddOutputDevice(this);
GLog->SerializeBacklog(this);
}
FRiderOutputDevice::~FRiderOutputDevice() {
if (onSerializeMessage.IsBound())
onSerializeMessage.Unbind();
// At shutdown, GLog may already be null
if (GLog != nullptr) {
GLog->RemoveOutputDevice(this);
}
}
void FRiderOutputDevice::Serialize(const TCHAR* V, ELogVerbosity::Type Verbosity, const FName& Category) {
onSerializeMessage.ExecuteIfBound(V, Verbosity, Category, {});
}
void FRiderOutputDevice::Serialize(const TCHAR* V, ELogVerbosity::Type Verbosity, const FName& Category,
const double Time) {
onSerializeMessage.ExecuteIfBound(V, Verbosity, Category, {Time});
}