From 02590a1766d0613a12ec3be95f10fd8f7057c402 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Sat, 20 Nov 2021 14:48:48 -0800 Subject: [PATCH] AzCoreLogSink will check if it's running in an editor-server and will allow stdouts Signed-off-by: Gene Walters --- Code/Framework/AzCore/AzCore/Debug/Trace.cpp | 4 ++-- Code/Legacy/CrySystem/AZCoreLogSink.h | 11 +++++++++++ .../Editor/MultiplayerEditorSystemComponent.cpp | 2 -- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Debug/Trace.cpp b/Code/Framework/AzCore/AzCore/Debug/Trace.cpp index 78dbf3c979..d8a39deebb 100644 --- a/Code/Framework/AzCore/AzCore/Debug/Trace.cpp +++ b/Code/Framework/AzCore/AzCore/Debug/Trace.cpp @@ -535,10 +535,10 @@ namespace AZ::Debug EBUS_EVENT(TraceMessageDrillerBus, OnOutput, window, message); TraceMessageResult result; EBUS_EVENT_RESULT(result, TraceMessageBus, OnOutput, window, message); - /* if (result.m_value) + if (result.m_value) { return; - }*/ + } } RawOutput(window, message); diff --git a/Code/Legacy/CrySystem/AZCoreLogSink.h b/Code/Legacy/CrySystem/AZCoreLogSink.h index 1b09c3198d..605367f418 100644 --- a/Code/Legacy/CrySystem/AZCoreLogSink.h +++ b/Code/Legacy/CrySystem/AZCoreLogSink.h @@ -180,6 +180,17 @@ public: CryLog("(%s) - %s", window, message); } + // If this is an editor-server, then allow the default trace behavior (fwrites to stdout) to occur + // The editor will being listening to the stdout of this server + if (const auto console = AZ::Interface::Get()) + { + bool editorsv_isDedicated = false; + if (console->GetCvarValue("editorsv_isDedicated", editorsv_isDedicated) == AZ::GetValueResult::Success) + { + return !editorsv_isDedicated; + } + } + return true; // suppress default AzCore behavior. } diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp index d75fbcbc70..669393e31e 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp @@ -420,8 +420,6 @@ namespace Multiplayer void MultiplayerEditorSystemComponent::OnTick(float, AZ::ScriptTimePoint) { - AZ_TracePrintf("MultiplayerEditorSystemComponent", "OnTick Pump"); - m_serverProcessTracePrinter->Pump(); }