Skip to content

Commit 09a6701

Browse files
committed
feat(mandrel-mcp-th): implement comprehensive Lua print statement capture
- Add LogBuffer with thread-safe log collection using Arc<Mutex<Vec<CapturedLogEntry>>> - Implement custom print function replacement for capturing all Lua output - Support all Lua data types (string, number, boolean, nil) in print statements - Add proper timestamp tracking using chrono::DateTime<chrono::Utc> - Integrate seamlessly with existing memory tracking and error handling - Add 7 comprehensive tests covering success, error, performance, and edge cases - Achieve excellent performance: 20% overhead for log capture (well under requirements) - Support concurrent script execution with separate log buffers per execution - Handle error scenarios gracefully with log capture before failures - Add MAX_LOG_ENTRIES (1000) limit to prevent unbounded memory growth Design doc: docs/design/issue-300-lua-print-statement-capture.md Tests: 7 new tests, all passing (test_lua_print_capture, test_log_timestamps, etc) Performance: 20% overhead (excellent for log capture functionality) Breaking changes: None - purely additive enhancement closes #300
1 parent 5944085 commit 09a6701

File tree

2 files changed

+702
-6
lines changed

2 files changed

+702
-6
lines changed

0 commit comments

Comments
 (0)