载入中...
搜索中...
未找到
ConsolePanel.cpp
浏览该文件的文档.
67 text += "\n[console: truncated " + std::to_string(size - keep) + " of " + std::to_string(size) + " bytes]";
252ConsoleSlice ConsolePanel::read(std::uint64_t afterSeq, size_t max, const std::string& level) const {
315 startStderrCapture([](const std::string& line) { ConsolePanel::instance().addEngineLine(line); });
320 addLog("warn", "engine stderr capture unavailable; only script print/error reaches this console");
Persistent, thread-safe record of engine crash and problem events.
Mirror process stderr into an in-process line sink without hiding it.
In-engine runtime console / log ring buffer for DevTools.
Definition ConsolePanel.hpp:58
std::uint64_t nextSeq() const
Sequence number the next appended line will receive.
Definition ConsolePanel.cpp:242
std::vector< ConsoleLine > recent(size_t max=128) const
Definition ConsolePanel.cpp:285
static void setImGuiDrawer(ImGuiDrawer fn)
Definition ConsolePanel.cpp:367
std::uint64_t droppedThrough() const
Highest sequence number no longer retained (evicted or cleared).
Definition ConsolePanel.cpp:247
void addLog(std::string level, std::string text)
Append a leveled log line (thread-safe).
Definition ConsolePanel.cpp:183
void(*)(ConsolePanel &panel) ImGuiDrawer
Definition ConsolePanel.hpp:123
void addEngineLine(const std::string &text)
Append one line captured from process stderr under level engine.
Definition ConsolePanel.cpp:204
std::string eval(const std::string &expression)
Evaluate a Squirrel expression against the root table and return a formatted result (or error message...
Definition ConsolePanel.cpp:332
bool isCapturingStderr() const
Whether process stderr is currently mirrored into this console.
Definition ConsolePanel.cpp:217
void attach(HSQUIRRELVM vm)
Attach to a Squirrel VM: capture print/script errors into the log.
Definition ConsolePanel.cpp:303
std::string format(size_t max=128) const
Definition ConsolePanel.cpp:294
ConsoleSlice read(std::uint64_t afterSeq, size_t max=64, const std::string &level={}) const
Read retained lines relative to a sequence cursor.
Definition ConsolePanel.cpp:252
void drawImGui()
Optional ImGui draw hook. Default no-op: console UI is registered by the host (see setImGuiDrawer) so...
Definition ConsolePanel.cpp:369
static SQRESULT compileBuffer(HSQUIRRELVM vm, const SQChar *source, SQInteger size, const SQChar *sourceName, SQBool raiseError)
Unified raw-VM entry used by REPL, debugger, MCP, and editor adapters.
Definition ScriptCompiler.cpp:694
Definition AgentDevelopmentMcp.cpp:12
void stopStderrCapture()
Restore stderr and join the drain thread. No-op when inactive.
Definition StderrCapture.cpp:168
bool stderrCaptureActive()
Whether stderr is currently mirrored into a sink.
Definition StderrCapture.cpp:189
StderrCaptureStatus startStderrCapture(StderrLineSink sink)
Start mirroring stderr into sink.
Definition StderrCapture.cpp:123
std::string formatScriptError(const ScriptErrorContext &ctx)
Formats a context into a human-readable multi-line report.
Definition ScriptError.cpp:200
ScriptErrorContext takeLastScriptError(HSQUIRRELVM vm)
Consumes and clears the last recorded error for a VM.
Definition ScriptError.cpp:222
ScriptErrorContext captureCompileError(HSQUIRRELVM vm)
Captures the last compilation error recorded by the VM.
Definition ScriptError.cpp:114
void recordLogEvent(const std::string &level, const std::string &message)
Appends a timestamped event line to the crash/error log.
Definition CrashLog.cpp:70
Definition ConsolePanel.hpp:16
One bounded read of the console ring buffer together with its cursors.
Definition ConsolePanel.hpp:32
Structured snapshot of a script error: message, throw site and stack.
Definition ScriptError.h:25