Files
o3de/Code/Tools/AssetProcessor/native/utilities/LogPanel.cpp
T
Steve Pham 38261d0800 Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
2021-07-16 15:25:48 -07:00

87 lines
2.5 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include "LogPanel.h"
#include <native/utilities/ThreadHelper.h>
namespace AssetProcessor
{
LogPanel::LogPanel(QWidget* parent)
: AzToolsFramework::LogPanel::StyledTracePrintFLogPanel(parent)
{
}
QWidget* LogPanel::CreateTab(const AzToolsFramework::LogPanel::TabSettings& settings)
{
LogTab* logTab = aznew LogTab(settings, this);
logTab->AddInitialLogMessage();
return logTab;
}
LogTab::LogTab(const AzToolsFramework::LogPanel::TabSettings& settings, QWidget* parent)
: AzToolsFramework::LogPanel::StyledTracePrintFLogTab(settings, parent)
{
}
void LogTab::AddInitialLogMessage()
{
LogTraceMessage(AzToolsFramework::Logging::LogLine::TYPE_MESSAGE, "AssetProcessor", "Started recording logs. To check previous logs please navigate to the logs folder.", true);
}
bool LogTab::OnAssert(const char* message)
{
if (AssetProcessor::GetThreadLocalJobId())
{
return false; // we are in a job thread
}
return AzToolsFramework::LogPanel::StyledTracePrintFLogTab::OnAssert(message);
}
bool LogTab::OnException(const char* message)
{
if (AssetProcessor::GetThreadLocalJobId())
{
return false; // we are in a job thread
}
return AzToolsFramework::LogPanel::StyledTracePrintFLogTab::OnException(message);
}
bool LogTab::OnPrintf(const char* window, const char* message)
{
if (AssetProcessor::GetThreadLocalJobId())
{
return false; // we are in a job thread
}
return AzToolsFramework::LogPanel::StyledTracePrintFLogTab::OnPrintf(window, message);
}
bool LogTab::OnError(const char* window, const char* message)
{
if (AssetProcessor::GetThreadLocalJobId())
{
return false; // we are in a job thread
}
return AzToolsFramework::LogPanel::StyledTracePrintFLogTab::OnError(window, message);
}
bool LogTab::OnWarning(const char* window, const char* message)
{
if (AssetProcessor::GetThreadLocalJobId())
{
return false; // we are in a job thread
}
return AzToolsFramework::LogPanel::StyledTracePrintFLogTab::OnWarning(window, message);
}
}