Expand description
Debug logging for external macros.
Writes to .macroforge/debug.log relative to the project root.
Use: macroforge_ts::debug::log("tag", "message") or macroforge_ts::debug_log!("tag", "...")
Debug logging for external macros.
Writes timestamped log entries to .macroforge/debug.log relative to the
project root (discovered by walking up from CWD). The file is created on
first write and appended to thereafter.
§Usage
ⓘ
use macroforge_ts::debug;
debug::log("Gigaform", "Starting expansion for User");
debug::log_ctx("Gigaform", &ctx); // logs the full MacroContextIR
debug::log_result("Gigaform", &result); // logs patch/diagnostic countsOr use the debug_log! macro for formatted messages:
ⓘ
macroforge_ts::debug_log!("MyMacro", "processing {type_name} with {n} fields");Functions§
- clear
- Clear the debug log (useful at the start of a build).
- log
- Append a single line to the debug log.
- log_ctx
- Log the
MacroContextIRsummary (macro name, module, file, target kind, field count). - log_
result - Log a
MacroResultsummary (patch counts, diagnostic counts, token length).