Is it possible to send messages to debugger console?

Oct 5, 2016 at 2:31 PM
ClearScript does not have a built-in console object to log messages.
console.log("Hello world");
If I implement one myself, how can direct messages to the debugger console?

The debugger can be either the Eclipse debugger or custom V8-compatible debugger.
Coordinator
Oct 5, 2016 at 6:08 PM
Hi ahmetuzun,

V8 and ClearScript neither support nor impede the implementation of any particular user interface, including a console window. If your application or debugger has a console window and provides an API for sending output to it, then that API should be easy to expose via ClearScript. It would probably be similar to the way the sample code on ClearScript's home page exposes System.Console.

Good luck!
Oct 6, 2016 at 7:10 AM
Edited Oct 6, 2016 at 7:13 AM
Ok, let me rephrase it like this:

node.js also uses the V8 engine. It has a built in console object which directs messages to the debugger console if the debugger is attached.

When I execute "console.log("Hello")" with node.js, I can see the "Hello" message both in my console and the debugger console.

V8 has a debugging protocol which all of the current debuggers use. (Eclipse and all others)

Sİnce you create a bridge between the V8 engine and the .NET world, do you know how to tell V8 send text messages to the debugger console?

Console.WriteLine does not direct messages to the debugger.
Coordinator
Oct 6, 2016 at 5:03 PM
We're not aware of any facility within V8's main API, debug API or debug protocol that supports console output. There appear to be some console-related features defined here, but ClearScript doesn't consume this newer API and we haven't investigated it. Sorry!
Oct 6, 2016 at 9:22 PM
I also could not find any console-related requests in the debug protocol.

I think node-inspector and other node.js debuggers implement something special to achieve this.

I will look deeper and share anything I can find here.

Thank you very much.