19#include <vlutil/vlPrint.h>
20#include <vrvImgui/imgui.h>
65 virtual void write(
const std::string& str,
int notify_level,
bool newLine)
override;
ImGuiTextBuffer myBuf
Single contiguous text buffer holding all log line text. Lines are null-terminated within the buffer ...
Definition debugLogPrinter.h:132
void disconnectFromAllStreams()
Disconnects this printer from all five global DtOutputStream instances.
bool myCopyMode
Whether copy-mode is active (read-only InputTextMultiline for selection).
Definition debugLogPrinter.h:166
DtImGuiLogPrinter(const DtImGuiLogPrinter &)=delete
virtual void write(const std::string &str, int notify_level, bool newLine) override
DtPrinter override — called by every DtOutputStream this printer is connected to.
void drawContents()
Renders the log contents inside an existing ImGui window or tab.
bool myLevelVisible[5]
Per-level visibility toggles (indexed by DtNotifyLevelType).
Definition debugLogPrinter.h:157
bool isDetached() const
Returns true when the log is displayed in its own window.
int myMaxLines
Maximum retained line count.
Definition debugLogPrinter.h:151
std::mutex myMutex
Guards all mutable state accessed by write() and draw().
Definition debugLogPrinter.h:127
int myPendingLevel
Notify level for the pending partial line.
Definition debugLogPrinter.h:148
DtImGuiLogPrinter(int maxLines=10000)
Constructs the log printer.
bool myConnected
Whether we are currently attached to the output streams.
Definition debugLogPrinter.h:169
void connectToAllStreams()
Connects this printer to all five global DtOutputStream instances.
bool myDetached
Whether the log is shown in its own detached ImGui window.
Definition debugLogPrinter.h:163
std::string mySnapshotText
Frame-local snapshot of the text buffer, built by takeSnapshot().
Definition debugLogPrinter.h:175
std::string myCopyText
Cached flattened text for copy-mode InputTextMultiline.
Definition debugLogPrinter.h:178
int myHead
Index of the oldest valid line in myLines (circular).
Definition debugLogPrinter.h:139
int myLineCount
Total number of valid lines currently stored.
Definition debugLogPrinter.h:142
void drawLogRegion()
Builds the scrollable log region using the current snapshot.
bool myAutoScroll
Whether to auto-scroll to the bottom on new output.
Definition debugLogPrinter.h:160
DtImGuiLogPrinter & operator=(const DtImGuiLogPrinter &)=delete
void drawDetachedWindow()
Renders the log in its own detached ImGui window.
void takeSnapshot()
Takes a thread-safe snapshot of the line metadata and text into mySnapshot / mySnapshotText.
virtual ~DtImGuiLogPrinter()
Virtual destructor.
void setDetached(bool detached)
Sets whether the log is displayed in its own window.
std::string myPendingLine
Partial line being accumulated before the next newLine==true write.
Definition debugLogPrinter.h:145
std::vector< LineInfo > myLines
Offset table describing each line stored in myBuf. Used as a circular array: valid lines are indices ...
Definition debugLogPrinter.h:136
void drawToolbar()
Builds the toolbar row (Clear, Auto-scroll, severity filters, Copy Mode, Detach).
void clear()
Discards all stored log lines.
ImGuiTextFilter myFilter
ImGui text filter for search.
Definition debugLogPrinter.h:154
void commitPendingLine()
Commits the pending partial line into the contiguous buffer.
bool myCopyTextDirty
True when myCopyText needs rebuilding (filter/severity/line count changed).
Definition debugLogPrinter.h:181
bool isConnected() const
Returns true when the printer is attached to the output streams.
std::vector< LineInfo > mySnapshot
Frame-local snapshot of LineInfo, built by takeSnapshot().
Definition debugLogPrinter.h:172
void compactIfNeeded()
Compacts the buffer when the oldest lines have been evicted, reclaiming dead space at the front.
Defines export macros for the VREngage Debug Manager library.
#define DEBUGMANAGER_DLL
Export/import macro for non-Windows platforms.
Definition export.h:40
!
Definition glsVreMessageUtil.h:50
Lightweight descriptor for one line inside the contiguous text buffer. 12 bytes per entry with no hea...
Definition debugLogPrinter.h:103
int level
Notify level (DtNlFatal … DtNlDebug).
Definition debugLogPrinter.h:106
int offset
Byte offset into myBuf where this line starts.
Definition debugLogPrinter.h:104
int length
Length of the line in bytes (excluding null terminator).
Definition debugLogPrinter.h:105