Skip to content

Output logpoints to debug console #710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jvalkeal opened this issue Nov 12, 2019 · 2 comments · Fixed by microsoft/java-debug#402
Closed

Output logpoints to debug console #710

jvalkeal opened this issue Nov 12, 2019 · 2 comments · Fixed by microsoft/java-debug#402

Comments

@jvalkeal
Copy link

Took a while to figure out that logpoints output simply goes to process(java process to debugged) output and not vscode's debug console as it's shown in docs. It'd be extremely helpful especially with remote debugging to get those logpoint messages back via debug protocol if that's possible.

If I'm right this System.out happens in this companion project JdtEvaluationProvider.java#L225

@wizlee
Copy link

wizlee commented Oct 22, 2021

Bump this old request as this will really be helpful when doing remote debugging.
When the logpoints message prints to stdout instead of vscode's debug console, it is much harder to find and track.

@sbj42
Copy link
Contributor

sbj42 commented Mar 15, 2022

Another place to look is SetBreakpointsRequestHandler.java#L219. There is some code there to notify the user if an error occurred in the logpoint evaluation by sending a UserNotificationEvent. That event is picked up in TypeScript at extension.ts#L126. If there was no error, this code doesn't do anything.

I'm just guessing, but maybe a fix would be for JdtEvaluationProvider.logMessageToExpression() to generate an expression which returns the formatted log message, then SetBreakpointsRequestHandler.handleEvaluationResult() would extract the string and send it in a new kind of event, say a "logpoint" event. Then extension.ts would handle that event and write to the debug console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants