Files
o3de/Code/Framework/AzQtComponents/AzQtComponents/Application/AzQtTraceLogger.cpp
T
Dayo Lawal 60c89d28cc New class: AzQtTraceLogger
Signed-off-by: Dayo Lawal <lawalfua@amazon.com>
2021-07-13 19:29:05 -05:00

39 lines
1.2 KiB
C++

/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include <AzQtComponents/Application/AzQtTraceLogger.h>
namespace AzQtComponents
{
bool AzQtTraceLogger::OnOutput(const char* window, const char* message)
{
// Suppress spam from the Source Control system
constexpr char sourceControlWindow[] = "Source Control";
if (0 == strncmp(window, sourceControlWindow, AZ_ARRAY_SIZE(sourceControlWindow)))
{
return true;
}
if (m_logFile)
{
m_logFile->AppendLog(AzFramework::LogFile::SEV_NORMAL, window, message);
}
else
{
m_startupLogSink.push_back({ window, message });
}
return false;
}
} // namespace AzQtComponents