Hi, my goal is to be able to log debug info for a specific feature in my game to my its output window. I know UE_LOG logs messages but it logs them all to the same place so it gets cluttered. I saw there was a Device Out Log which looks like it lets you specify a custom device to be logged to. I did some research and ended up overriding FOutputDevice like so
.h
class PROJECTSMI_API MissionOutputDevice : public FOutputDevice
{
public:
MissionOutputDevice();
~MissionOutputDevice();
virtual void Serialize(const TCHAR* V, ELogVerbosity::Type Verbosity, const FName& Category) override
{
// Not sure what I need to put here...
}
};
.cpp
MissionOutputDevice::MissionOutputDevice()
{
check(GLog);
GLog->AddOutputDevice(this);
if (GLog->IsRedirectingTo(this))
return; // Never gets hit
return;
}
MissionOutputDevice::~MissionOutputDevice()
{
if (GLog != nullptr)
{
GLog->RemoveOutputDevice(this);
}
}
Anyways, doing this never adds this custom output device to the Device Output Window as an option and when I debug it that line in the constructor if (GLog->IsRedirectingTo(this)) always returns false. Any help would be appreciated.