Implement log breakpoints#1086
Open
lionel- wants to merge 1 commit intofeature/conditional-breakpointsfrom
Open
Implement log breakpoints#1086lionel- wants to merge 1 commit intofeature/conditional-breakpointsfrom
lionel- wants to merge 1 commit intofeature/conditional-breakpointsfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Branched from #1064.
Adds support for DAP log breakpoints (logpoints). When a breakpoint has a log message template instead of (or in addition to) a condition, it evaluates the template at hit time, prints the result to the debug console, and does not stop execution. This is the DAP "logpoint" feature.
The log message template uses
{expression}placeholders for interpolation, as mandated by the DAP spec. On the R side, interpolation is handled byglue::glue()if we detect a{character. This fails actionnably (message in Console output) if glue is not installed. If there is no{character, the template is returned as is, allowing simple messages to work without the glue dependency.Log breakpoints respect conditions: if a breakpoint has both a condition and a log message, the condition is evaluated first and the log message only fires when the condition is met. This naturally extends to hit-count breakpoints in the future, since they'll slot into the same pre-check phase. The flow in
ps_should_breakis now: enabled check → condition evaluation → log-or-stop.Output is emitted through the same
emit_breakpoint_outputpath as conditional breakpoints, using the```breakpointfenced block with a clickable file link. When there's no condition, the condition header line (#> ...) is omitted and only the log message content is shown.With an error we get:
QA Notes
Tested on the backend side.
To test manually:
y <- x * 2with messagex is {x}, y will be {x * 2}. Run the loop — should see 5 log messages in the console without stopping.x > 3to the same log breakpoint. Run the loop — should only see messages forx = 4andx = 5.{nonexistent}: should show an inline error without stopping.checkpoint reachedshould work. A log message with glue syntax should fail actionably (error in console output).