ImGuiLogSink Class
LogSink implementation that forwards messages to a LogWidget. More...
Declaration
Base class
| class | helios::util::log::LogSink |
Public Constructors Index
| ImGuiLogSink (widgets::LogWidget *widget) | |
|
Constructs an ImGuiLogSink attached to a LogWidget. More... | |
Public Member Functions Index
| helios::util::log::SinkTypeId | typeId () const noexcept override |
|
Returns the unique type identifier for this sink. More... | |
| void | write (helios::util::log::LogLevel level, const std::string &scope, const std::string &message) override |
|
Forwards a log message to the LogWidget. More... | |
Private Member Attributes Index
| widgets::LogWidget * | widget_ = nullptr |
|
Pointer to the LogWidget to forward messages to. More... | |
Public Static Attributes Index
| static constexpr helios::util::log::SinkTypeId | TYPE_ID = "imgui" |
|
Unique type identifier for this sink. More... | |
Description
LogSink implementation that forwards messages to a LogWidget.
This sink bridges the helios logging system with the ImGui-based LogWidget, allowing log output to be displayed in the debug overlay instead of (or in addition to) the console.
```cpp auto logWidget = std::make_shared<widgets::LogWidget>(); overlay.addWidget(logWidget.get());
auto sink = std::make_shared<ImGuiLogSink>(logWidget.get()); LogManager::getInstance().registerSink(sink); ```
Definition at line 32 of file ImGuiLogSink.ixx.
Public Constructors
ImGuiLogSink()
| inline explicit |
Constructs an ImGuiLogSink attached to a LogWidget.
- Parameters
-
widget Pointer to the LogWidget to receive messages. Must remain valid for the lifetime of this sink.
Definition at line 52 of file ImGuiLogSink.ixx.
Public Member Functions
typeId()
| inline nodiscard noexcept virtual |
Returns the unique type identifier for this sink.
- Returns
"imgui".
Definition at line 60 of file ImGuiLogSink.ixx.
Reference TYPE_ID.
write()
| inline virtual |
Forwards a log message to the LogWidget.
- Parameters
-
level The severity level of the message.
scope The source scope/module name.
message The log message text.
Definition at line 71 of file ImGuiLogSink.ixx.
References helios::ext::imgui::widgets::Debug, helios::util::log::Debug, helios::ext::imgui::widgets::Error, helios::util::log::Error, helios::ext::imgui::widgets::Info, helios::util::log::Info, helios::ext::imgui::widgets::Warn and helios::util::log::Warn.
Private Member Attributes
widget_
|
Pointer to the LogWidget to forward messages to.
Definition at line 38 of file ImGuiLogSink.ixx.
Public Static Attributes
TYPE_ID
| constexpr static |
Unique type identifier for this sink.
Definition at line 44 of file ImGuiLogSink.ixx.
Referenced by typeId.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.