LogPanel.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzToolsFramework/UI/Logging/StyledTracePrintFLogPanel.h>
  10. namespace AssetProcessor
  11. {
  12. //! LogPanel - an implementation of TracePrintFLogPanel which shows recent traceprintfs
  13. //! CreateTabs will create a new instance of LogTab
  14. class LogPanel : public AzToolsFramework::LogPanel::StyledTracePrintFLogPanel
  15. {
  16. public:
  17. explicit LogPanel(QWidget* parent = nullptr);
  18. ~LogPanel() override = default;
  19. protected:
  20. QWidget* CreateTab(const AzToolsFramework::LogPanel::TabSettings& settings) override;
  21. };
  22. //! LogTab - a Log View listening on AZ Traceprintfs and puts them in a ring buffer
  23. //! It also filters traceprintfs based on the thread local job id
  24. class LogTab : public AzToolsFramework::LogPanel::StyledTracePrintFLogTab
  25. {
  26. public:
  27. AZ_CLASS_ALLOCATOR(LogTab, AZ::SystemAllocator);
  28. explicit LogTab(const AzToolsFramework::LogPanel::TabSettings& settings, QWidget* parent = nullptr);
  29. ~LogTab() override = default;
  30. void AddInitialLogMessage();
  31. //////////////////////////////////////////////////////////////////////////
  32. // TraceMessagesBus
  33. bool OnAssert(const char* message) override;
  34. bool OnException(const char* message) override;
  35. bool OnError(const char* window, const char* message) override;
  36. bool OnWarning(const char* window, const char* message) override;
  37. bool OnPrintf(const char* window, const char* message) override;
  38. //////////////////////////////////////////////////////////////////////////
  39. };
  40. }