Commit be6a960
committed
refactor: implement two-phase PrintIR + Renderer for console/util.inspect
Refactors the logging library to use a two-phase approach:
- Phase 1: Build intermediate representation (PrintIR enum) from JS values
- Phase 2: Render IR to formatted string with formatting decisions
This enables:
- Shared codebase between console.log and util.inspect
- Dynamic formatting based on breakLength/compact options
- Better separation of concerns for future enhancements
New files:
- ir.rs: PrintIR enum for intermediate representation
- builder.rs: Converts JS values to PrintIR
- renderer.rs: Renders PrintIR to formatted strings
Also adds util.inspect to API.md documentation.1 parent 3b20c9a commit be6a960
File tree
5 files changed
+1509
-893
lines changed- libs/llrt_logging/src
5 files changed
+1509
-893
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
| 385 | + | |
| 386 | + | |
385 | 387 | | |
386 | 388 | | |
387 | 389 | | |
| |||
0 commit comments