Fewer log messages from UE Wingman
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
#include "UObject/StrongObjectPtr.h"
|
#include "UObject/StrongObjectPtr.h"
|
||||||
#include "AssetRegistry/AssetRegistryModule.h"
|
#include "AssetRegistry/AssetRegistryModule.h"
|
||||||
#include "AssetRegistry/IAssetRegistry.h"
|
#include "AssetRegistry/IAssetRegistry.h"
|
||||||
|
#include "Misc/CoreDelegates.h"
|
||||||
#include "Misc/OutputDeviceRedirector.h"
|
#include "Misc/OutputDeviceRedirector.h"
|
||||||
#include "Serialization/JsonReader.h"
|
#include "Serialization/JsonReader.h"
|
||||||
#include "Serialization/JsonSerializer.h"
|
#include "Serialization/JsonSerializer.h"
|
||||||
@@ -55,8 +56,7 @@ void UWingServer::Initialize(FSubsystemCollectionBase& Collection)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildWingHandlerRegistry();
|
LoadingPhasesCompleteHandle = FCoreDelegates::OnAllModuleLoadingPhasesComplete.AddUObject(this, &UWingServer::BuildWingHandlerRegistry);
|
||||||
ModulesChangedHandle = FModuleManager::Get().OnModulesChanged().AddUObject(this, &UWingServer::OnModulesChanged);
|
|
||||||
LogCapture.bEnabled = false;
|
LogCapture.bEnabled = false;
|
||||||
GLog->AddOutputDevice(&LogCapture);
|
GLog->AddOutputDevice(&LogCapture);
|
||||||
bRunning = true;
|
bRunning = true;
|
||||||
@@ -65,7 +65,7 @@ void UWingServer::Initialize(FSubsystemCollectionBase& Collection)
|
|||||||
|
|
||||||
void UWingServer::Deinitialize()
|
void UWingServer::Deinitialize()
|
||||||
{
|
{
|
||||||
FModuleManager::Get().OnModulesChanged().Remove(ModulesChangedHandle);
|
FCoreDelegates::OnAllModuleLoadingPhasesComplete.Remove(LoadingPhasesCompleteHandle);
|
||||||
|
|
||||||
if (!bRunning)
|
if (!bRunning)
|
||||||
{
|
{
|
||||||
@@ -534,11 +534,6 @@ void UWingServer::BuildWingHandlerRegistry()
|
|||||||
WingHandlerRegistry.Sort([](const FWingHandlerConfig& A, const FWingHandlerConfig& B) { return A.Name < B.Name; });
|
WingHandlerRegistry.Sort([](const FWingHandlerConfig& A, const FWingHandlerConfig& B) { return A.Name < B.Name; });
|
||||||
}
|
}
|
||||||
|
|
||||||
void UWingServer::OnModulesChanged(FName ModuleName, EModuleChangeReason Reason)
|
|
||||||
{
|
|
||||||
BuildWingHandlerRegistry();
|
|
||||||
}
|
|
||||||
|
|
||||||
FWingHandlerConfig* UWingServer::FindHandler(const FString& Name)
|
FWingHandlerConfig* UWingServer::FindHandler(const FString& Name)
|
||||||
{
|
{
|
||||||
int32 Index = Algo::LowerBoundBy(WingHandlerRegistry, Name, [](const FWingHandlerConfig& H) { return H.Name; });
|
int32 Index = Algo::LowerBoundBy(WingHandlerRegistry, Name, [](const FWingHandlerConfig& H) { return H.Name; });
|
||||||
|
|||||||
@@ -76,8 +76,7 @@ private:
|
|||||||
FLogCaptureOutputDevice LogCapture; // installed once at startup, enabled per-request
|
FLogCaptureOutputDevice LogCapture; // installed once at startup, enabled per-request
|
||||||
TArray<FWingHandlerConfig> WingHandlerRegistry; // sorted by Name
|
TArray<FWingHandlerConfig> WingHandlerRegistry; // sorted by Name
|
||||||
void BuildWingHandlerRegistry();
|
void BuildWingHandlerRegistry();
|
||||||
void OnModulesChanged(FName ModuleName, EModuleChangeReason Reason);
|
FDelegateHandle LoadingPhasesCompleteHandle;
|
||||||
FDelegateHandle ModulesChangedHandle;
|
|
||||||
FWingHandlerConfig* FindHandler(const FString& Name);
|
FWingHandlerConfig* FindHandler(const FString& Name);
|
||||||
|
|
||||||
// Handle a complete JSON line and return the response JSON
|
// Handle a complete JSON line and return the response JSON
|
||||||
|
|||||||
Reference in New Issue
Block a user