Skip to content
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

Sending STDOUT and STDERR output to external debugger console ... #19

Open
DanRathbun opened this issue Sep 22, 2018 · 5 comments
Open
Labels

Comments

@DanRathbun
Copy link

How to send STDOUT and STDERR output to external debugger console instead of SketchUp's internal Ruby Console ?

puts() seems not to work.

On Windows I tried OutputDebugString and it sends to MS DebugView, but I see nothing in VSCODE's console.

Is there a "mixed" or "managed" mode setting somewhere for VSCODE ?

@BugraBarin
Copy link
Member

This would be nice. But I don't believe the ruby-debug-ide protocol supports a way to send such output to the debugger client. I might be wrong though.

@DanRathbun
Copy link
Author

Backstory: I'm weary of SketchUp's internal Ruby Console being broken every few releases. I'd like to send console output to something external and leave SketchUp's console closed.

@thomthom
Copy link
Member

thomthom commented Oct 4, 2018

I actually started on something like this a couple of weeks ago. It doesn't redirect STDOUT/STDERR, but a logger utility that would by default output to $stdout, but with an option to connect to an output server via sockets.

traceup

@thomthom thomthom changed the title [Q] Sending STDOUT and STDERR output to external debugger console ... Sending STDOUT and STDERR output to external debugger console ... Oct 4, 2018
@DanRathbun
Copy link
Author

Have you ever tried Ruby's Logger utility ?
http://ruby-doc.org/stdlib-2.2.4/libdoc/logger/rdoc/index.html

It has a lot of built-in nifty housekeeping stuff. I was thinking of using it and perhaps subclassing it for use in embedded SketchUp.

Although, I'd set up a mixin protocol where the various methods (warn, info, debug, etc., ...) could be used without qualification, and the extension itself instantiates the logger instance object when it loads (if logging is enabled.)

If endusers had issues, the logs could be sent to a server similar to how reports are sent to Windows Error Reporting or BugSplat.

@thomthom
Copy link
Member

thomthom commented Oct 4, 2018

Yea, I've had a look at that in some projects. Useful when you want to log to a file. (So user can send you it if SU crashes etc, or keep useful info to help repro issues.)
The tool I showed earlier in this thread was a little bit different in purpose, more of a way to keep track of the current value of a given variable.

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

No branches or pull requests

3 participants