0

I'm playing with chrome dev_tools (the source code, not the app) per https://developer.chrome.com/devtools/docs/contributing as a learning exercise before I write an extension panel.

I curiously noted that console.log statements from these tools do not seem to end up in the console. While this was unexpected at first it makes sense. I also noted that internal dev_tools like Timeline and Console do not seem to have access to "getBackgroundPage" (see google chrome extension :: console.log() from background page? for info). Accessing chrome.extension is undefined :(. I can however call console.log, I just seem to be unable to find where this logs to :/.

In the interim I've come up with an annoying workaround where by I make sure each class has a reference to WebInspector.console ala

WebInspector.TimelineModel.console = WebInspector.console;

And then wrap and use this to make the results of a logging function I wrote end up in inspector console for the tab in question:

var bglog = function(obj, thing) {
    WebInspector.TimelineModel.console.log(obj, thing);
};

Anyone have any better ideas?

Community
  • 1
  • 1
j03m
  • 5,195
  • 4
  • 46
  • 50
  • I'm not sure, but ssince those are Chrome internals, possibly you could just output it in normal Chrome-wide logging facilities? – Xan Dec 08 '14 at 16:13
  • Yes - this is a duplicate. Just reviewed that link and it addresses the issue. What is the correct thing to do here? vote to close or delete? – j03m Dec 08 '14 at 18:51

0 Answers0