Bug 17234 - Inspector should link console.{log,warn,info,error} back to call site
Summary: Inspector should link console.{log,warn,info,error} back to call site
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Timothy Hatcher
URL:
Keywords: InRadar
: 19791 (view as bug list)
Depends on:
Blocks: 14354
  Show dependency treegraph
 
Reported: 2008-02-08 13:56 PST by Adam Roben (:aroben)
Modified: 2008-09-02 15:00 PDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (15.86 KB, patch)
2008-09-02 10:09 PDT, Timothy Hatcher
kmccullough: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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
<rdar://problem/5732837>
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.