rustemo
rustemo copied to clipboard
No verbose logging by default (and un-disableable logging)
When you run the parser it logs a bunch of stuff. IIUC this is controlled by two things
- On by default in debug builds
cfg(debug_assertions) - Disabled at runtime by specifying
RUSTEMO_NOTRACE
These are very verbose and not useful for end users except in the case that a parse fails, so I'd like to make the case by having it off by default and flipping the variable to something like RUSTEMO_TRACE.
That said, even with RUSTEMO_NOTRACE I get a bunch of
context.position() = 34
context.location() = [1,34]
logs.
One other thought is that, if a parse fails, I may want to present trace information to the user but not via the console: via UI or something. In that case, being able to get the trace logs as an object (part of the error?) instead of having it go to the console would be useful. I don't currently have that requirement though (or at least, I haven't had to debug any complex parses).