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

Implement bindings for debug-interface to use builtin console #436

Closed
kevinkassimo opened this issue Aug 16, 2020 · 3 comments
Closed

Implement bindings for debug-interface to use builtin console #436

kevinkassimo opened this issue Aug 16, 2020 · 3 comments

Comments

@kevinkassimo
Copy link
Contributor

kevinkassimo commented Aug 16, 2020

Background: this was brought up in https://twitter.com/KevKassimo/status/1294695571446312961

It seems that we currently don't have bindings to debug-interface.h APIs, such that things like SetConsoleDelegate(to attach handlers for V8 builtin console) is not directly accessible. https://source.chromium.org/chromium/chromium/src/+/master:v8/src/debug/debug-interface.h;l=226-227;drc=459283200c38b18e13566549532ad4d7121451ef

Sample usage of this specific API could be found here: https://source.chromium.org/chromium/chromium/src/+/master:v8/src/d8/d8.cc;l=2312;drc=7e9322335ee659e70c0239fc402db7d86f4b56d6

(I still cannot experiment with anything myself yet, so maybe someone else can take the work if they want to)

@bnoordhuis
Copy link
Contributor

debug-interface.h is a private header, it's not part of the public API. It's used by d8, but d8 uses all kinds of internal V8 APIs.

I can't quite divine from the twitter thread what the actual problem is (cc @MylesBorins, maybe you can clarify) but if you want to intercept console messages, the V8InspectorClientImpl::console_api_message() method I added in #252 lets you do that.

@MylesBorins
Copy link

So at a very very high level all I want to do is make the console object actually print something (wild I know). I can think of a couple different creative ways to make it work... but if possible I would like to do it idiomaticaly.

@piscisaureus
Copy link
Member

I think you might have to implement your own Console object.
AFAIK the built-in console object only forwards messages to the chrome inspector console.

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

No branches or pull requests

4 participants