Bug 17234

Summary: Inspector should link console.{log,warn,info,error} back to call site
Product: WebKit Reporter: Adam Roben (:aroben) <aroben>
Component: Web Inspector (Deprecated)Assignee: Timothy Hatcher <timothy>
Severity: Enhancement CC: keishi
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 14354    
Description Flags
Proposed patch kmccullough: review+

Description Adam Roben (:aroben) 2008-02-08 13:56:26 PST
The Inspector should link the output from console.{log,warn,info,error} back to the call site.
Comment 1 Adam Roben (:aroben) 2008-02-08 14:18:28 PST
Comment 2 Adam Roben (:aroben) 2008-03-31 14:02:34 PDT
In general we have no way of knowing what line number the console.* method was called on.
Comment 3 Adam Roben (:aroben) 2008-03-31 14:06:37 PDT
(In reply to comment #2)
> In general we have no way of knowing what line number the console.* method was
> called on.

...nor do we know what the URL of the script that made the call was.

Comment 4 Geoffrey Garen 2008-07-23 20:36:31 PDT
One way to solve this problem would be for console.log to use a special CallType that gets additional information passed to it when it's called as a function.

Basically, this would require:

* Add a new CallType to the CallType enum in JavaScriptCore
* Make console.log's getCallData function return that CallType
* Change the sites in JavaScriptCore that deal with CallType to handle this new CallType (I think there are about 4)
Comment 5 Keishi Hattori 2008-08-11 07:14:11 PDT
*** Bug 19791 has been marked as a duplicate of this bug. ***
Comment 6 Keishi Hattori 2008-08-11 08:34:53 PDT
(In reply to comment #4 at bug #19791)
> I think using CustomCall for the Console object is fine. The majority of the
> console functions want this info.

I tried doing "interface [CustomCall] Console {" but that doesn't seem to change the CallTypes for console.*. Calling console() seems to have the new custom CallType but that's not what I want. 
Comment 7 Kevin McCullough 2008-08-18 11:06:26 PDT
I talked with Geoff about how to get the line numbers and source files for more
than just these functions.  I think we are going to be taking this in another
direction.  Once that lands, these should be simple to implement.
Comment 8 Timothy Hatcher 2008-09-02 10:09:58 PDT
Created attachment 23116 [details]
Proposed patch
Comment 9 Timothy Hatcher 2008-09-02 15:00:36 PDT
Landed in r36029.