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

50 lines
1.5 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.
*
*/
#pragma once
#include <AzFramework/Logging/LogFile.h>
#include <AzCore/Debug/TraceMessageBus.h>
namespace AzQtComponents
{
class AzQtTraceLogger : private AZ::Debug::TraceMessageBus::Handler
{
public:
AzQtTraceLogger()
{
AZ::Debug::TraceMessageBus::Handler::BusConnect();
}
~AzQtTraceLogger()
{
AZ::Debug::TraceMessageBus::Handler::BusDisconnect();
}
protected:
//////////////////////////////////////////////////////////////////////////
// AZ::Debug::TraceMessageBus::Handler overrides...
bool OnOutput(const char* window, const char* message) override;
//////////////////////////////////////////////////////////////////////////
struct LogMessage
{
public:
AZStd::string window;
AZStd::string message;
};
AZStd::vector<LogMessage> m_startupLogSink;
AZStd::unique_ptr<AzFramework::LogFile> m_logFile;
};
}