Instead of AZCoreLogSink pulling a cvar, we'll check if we're running an editor-server on SystemInit

Signed-off-by: Gene Walters <genewalt@amazon.com>
This commit is contained in:
Gene Walters
2021-11-24 16:05:53 -08:00
parent 4b9aae5a1a
commit 77e3dd786d
2 changed files with 17 additions and 15 deletions
+12 -1
View File
@@ -737,7 +737,18 @@ bool CSystem::Init(const SSystemInitParams& startupParams)
m_pCmdLine = new CCmdLine(startupParams.szSystemCmdLine);
AZCoreLogSink::Connect();
// Init AZCoreLogSink. Don't suppress system output if we're running as an editor-server
bool suppressSystemOutput = true;
if (const ICmdLineArg* isEditorServerArg = m_pCmdLine->FindArg(eCLAT_Pre, "editorsv_isDedicated"))
{
AZ::CVarFixedString lowercaseValue(isEditorServerArg->GetValue());
AZStd::to_lower(lowercaseValue.begin(), lowercaseValue.end());
if (lowercaseValue == "true")
{
suppressSystemOutput = false;
}
}
AZCoreLogSink::Connect(suppressSystemOutput);
// Registers all AZ Console Variables functors specified within CrySystem
if (auto azConsole = AZ::Interface<AZ::IConsole>::Get(); azConsole)