diff --git a/Plugins/UEWingman/Source/UEWingman/Private/WingServer.cpp b/Plugins/UEWingman/Source/UEWingman/Private/WingServer.cpp index ab54fab3..1bc7130d 100644 --- a/Plugins/UEWingman/Source/UEWingman/Private/WingServer.cpp +++ b/Plugins/UEWingman/Source/UEWingman/Private/WingServer.cpp @@ -4,6 +4,7 @@ #include "UObject/StrongObjectPtr.h" #include "AssetRegistry/AssetRegistryModule.h" #include "AssetRegistry/IAssetRegistry.h" +#include "Misc/OutputDeviceRedirector.h" #include "Serialization/JsonReader.h" #include "Serialization/JsonSerializer.h" #include "SocketSubsystem.h" @@ -57,7 +58,7 @@ void UWingServer::Initialize(FSubsystemCollectionBase& Collection) BuildWingHandlerRegistry(); ModulesChangedHandle = FModuleManager::Get().OnModulesChanged().AddUObject(this, &UWingServer::OnModulesChanged); LogCapture.bEnabled = false; - LogCapture.Install(); + GLog->AddOutputDevice(&LogCapture); bRunning = true; UE_LOG(LogTemp, Display, TEXT("UEWingman: MCP server listening on tcp://localhost:%d"), Port); } @@ -113,7 +114,7 @@ void UWingServer::Deinitialize() ListenSocket = nullptr; } - LogCapture.Uninstall(); + GLog->RemoveOutputDevice(&LogCapture); bRunning = false; bShuttingDown = false; GWingServer = nullptr; diff --git a/Plugins/UEWingman/Source/UEWingman/Public/WingLogCapture.h b/Plugins/UEWingman/Source/UEWingman/Public/WingLogCapture.h index e9c26e5d..6cc5e8d0 100644 --- a/Plugins/UEWingman/Source/UEWingman/Public/WingLogCapture.h +++ b/Plugins/UEWingman/Source/UEWingman/Public/WingLogCapture.h @@ -1,7 +1,7 @@ #pragma once #include "CoreMinimal.h" -#include "Misc/OutputDeviceRedirector.h" +#include "Misc/OutputDevice.h" class FLogCaptureOutputDevice : public FOutputDevice { @@ -9,9 +9,6 @@ public: TArray CapturedErrors; bool bEnabled = false; - void Install() { GLog->AddOutputDevice(this); } - void Uninstall() { GLog->RemoveOutputDevice(this); } - // If the device is marked 'CanBeUsedOnMultipleThreads,' // then UE_LOG will call Serialize from the current // thread, otherwise, it will call Serialize from the diff --git a/Plugins/UEWingman/Source/UEWingman/Public/WingServer.h b/Plugins/UEWingman/Source/UEWingman/Public/WingServer.h index 497f256b..590812e0 100644 --- a/Plugins/UEWingman/Source/UEWingman/Public/WingServer.h +++ b/Plugins/UEWingman/Source/UEWingman/Public/WingServer.h @@ -18,7 +18,7 @@ class FSocket; * * Clients connect via TCP and exchange null-delimited JSON messages. * Request format: {"command": "tool_name", "param1": "value1", ...} - * Response format: raw JSON result from the handler. + * Response format: Text. * * Each connected client gets its own thread for blocking I/O; * tool calls are dispatched on the game thread.