2#include "../UI/Panel.h"
88 static void Print(
const std::string &message);
90 static void PrintError(
const std::string &message);
91 static void PrintDebug(
const std::string &message);
95 std::vector<ConsoleMessage> m_messages;
96 bool m_autoScroll =
true;
97 bool m_showTimestamps =
true;
100 bool m_showInfo =
true;
101 bool m_showWarning =
true;
102 bool m_showError =
true;
103 bool m_showDebug =
true;
104 bool m_showSuccess =
true;
107 static std::unique_ptr<Console> s_instance;
121 const char *GetMessagePrefix(
MessageType type)
const;
128 std::string FormatTimestamp(
const std::chrono::steady_clock::time_point ×tamp)
const;
A panel component that provides console functionality in the editor.
Definition Console.h:51
static void Print(const std::string &message)
Definition Console.cpp:184
static Console & GetInstance()
Gets the singleton instance of the console.
Definition Console.cpp:21
static void PrintSuccess(const std::string &message)
Definition Console.cpp:204
void AddMessage(const std::string &message, MessageType type=MessageType::Info)
Adds a message to the console.
Definition Console.cpp:117
~Console()
Destructor that cleans up console resources.
static void PrintError(const std::string &message)
Definition Console.cpp:194
void Draw() override
Renders the console panel interface. @override Implements the abstract method from the Panel base cla...
Definition Console.cpp:30
void Clear()
Clears all messages from the console.
Definition Console.cpp:127
static void PrintDebug(const std::string &message)
Definition Console.cpp:199
static void PrintWarning(const std::string &message)
Definition Console.cpp:189
Console()
Constructor that sets up the console.
Definition Console.cpp:11
Base class for all UI panels in the editor.
Definition Panel.h:19
Represents the Inspector panel component in the Editor.
Definition Console.cpp:7
void DebugPrintWarning(const std::string &message)
Definition Console.cpp:215
void DebugPrintError(const std::string &message)
Definition Console.cpp:220
void DebugPrint(const std::string &message)
Definition Console.cpp:210
void DebugPrintDebug(const std::string &message)
Definition Console.cpp:225
MessageType
Defines different types of console messages.
Definition Console.h:23
void DebugPrintSuccess(const std::string &message)
Definition Console.cpp:230
Represents a single message in the console.
Definition Console.h:36
std::string text
Definition Console.h:37
ConsoleMessage(const std::string &msg, MessageType msgType)
Definition Console.h:41
std::chrono::steady_clock::time_point timestamp
Definition Console.h:39
MessageType type
Definition Console.h:38