Merge pull request #5820 from aws-lumberyard-dev/LYN-8025_PipeEditorServerLogsToEditor

Pipe Editor-Server Logs Back to the Editor
This commit is contained in:
Gene Walters
2021-12-01 07:36:02 -08:00
committed by GitHub
16 changed files with 129 additions and 46 deletions
+8 -6
View File
@@ -36,9 +36,10 @@ public:
Disconnect();
}
inline static void Connect()
inline static void Connect(bool suppressSystemOutput)
{
GetInstance().m_ignoredAsserts = new IgnoredAssertMap();
GetInstance().m_suppressSystemOutput = suppressSystemOutput;
GetInstance().BusConnect();
}
@@ -126,7 +127,7 @@ public:
CryLogAlways("%s", message);
}
return true; // suppress default AzCore behavior.
return m_suppressSystemOutput;
#else
AZ_UNUSED(fileName);
AZ_UNUSED(line);
@@ -146,7 +147,7 @@ public:
return false; // allow AZCore to do its default behavior.
}
gEnv->pLog->LogError("(%s) - %s", window, message);
return true; // suppress default AzCore behavior.
return m_suppressSystemOutput;
}
bool OnPreWarning(const char* window, const char* fileName, int line, const char* func, const char* message) override
@@ -161,7 +162,7 @@ public:
}
CryWarning(VALIDATOR_MODULE_UNKNOWN, VALIDATOR_WARNING, "(%s) - %s", window, message);
return true; // suppress default AzCore behavior.
return m_suppressSystemOutput;
}
bool OnOutput(const char* window, const char* message) override
@@ -179,12 +180,13 @@ public:
{
CryLog("(%s) - %s", window, message);
}
return true; // suppress default AzCore behavior.
return m_suppressSystemOutput;
}
private:
using IgnoredAssertMap = AZStd::unordered_map<AZ::Crc32, bool, AZStd::hash<AZ::Crc32>, AZStd::equal_to<AZ::Crc32>, AZ::OSStdAllocator>;
IgnoredAssertMap* m_ignoredAsserts;
bool m_suppressSystemOutput = true;
};
+17
View File
@@ -42,5 +42,22 @@ const int CCmdLineArg::GetIValue() const
{
return atoi(m_value.c_str());
}
const bool CCmdLineArg::GetBoolValue(bool& cmdLineValue) const
{
AZStd::string lowercaseValue(m_value);
AZStd::to_lower(lowercaseValue.begin(), lowercaseValue.end());
if (lowercaseValue == "true")
{
cmdLineValue = true;
return true;
}
if (lowercaseValue == "false")
{
cmdLineValue = false;
return true;
}
return false;
}
+1
View File
@@ -30,6 +30,7 @@ public:
const ECmdLineArgType GetType() const;
const float GetFValue() const;
const int GetIValue() const;
const bool GetBoolValue(bool& cmdLineValue) const;
private:
+11 -1
View File
@@ -737,7 +737,17 @@ 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"))
{
bool editorsv_isDedicated = false;
if (isEditorServerArg->GetBoolValue(editorsv_isDedicated) && editorsv_isDedicated)
{
suppressSystemOutput = false;
}
}
AZCoreLogSink::Connect(suppressSystemOutput);
// Registers all AZ Console Variables functors specified within CrySystem
if (auto azConsole = AZ::Interface<AZ::IConsole>::Get(); azConsole)