Open Bug 1060904 Opened 11 years ago Updated 3 years ago

Black box top N frames when deriving log message source location

Categories

(DevTools :: Console, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: till, Unassigned)

Details

It's fairly common for log messages to be managed centrally for larger applications. In that case, all messages are displayed as originating from the same source location, which isn't all that helpful. Instead, it'd be nice to be able to black-box the top N stack frames when looking up the source location. I realize that this might have unacceptable overhead in the case of background logging with the console closed. Maybe it's ok to only do it if the console is open when the message is logged? Or perhaps even restrict it to debuggee compartments?
This is the approach used in Chrome devtools
(In reply to Zac Spitzer from comment #1) > This is the approach used in Chrome devtools I assume you mean this? https://gist.github.com/paulirish/c307a5a585ddbcc17242 If so, that doesn't really help our use case, because we most definitely don't want to blackbox the entire script the logging function is in. It'd have to be more targeted than per-file blackboxing.
Product: Firefox → DevTools
I guess that's something that could be solved with customizable callstacks (See Bug 882825)
Severity: normal → enhancement
Honestly, this is one of the main reasons I haven't used FF as my primary browser for development in several years. Could it be added as an preference? It's not a perfect solution, but it's far better than the current situation. The reason I use a central logging function is so that when an error is encountered, I maintain a buffer of console log entries and I include that with the stack in error reporting, which is extremely useful for diagnosing problems from end users.
(In reply to Zac Spitzer from comment #4) > Honestly, this is one of the main reasons I haven't used FF as my primary > browser for development in several years. > > Could it be added as an preference? It's not a perfect solution, but it's > far better than the current situation. > > The reason I use a central logging function is so that when an error is > encountered, I maintain a buffer of console > log entries and I include that with the stack in error reporting, which is > extremely useful for diagnosing > problems from end users. Thanks for your reply :) So how's Firefox acting differently than other browsers here ?
In Chrome if you have two files, base.js and app.js and base has a wrapped console.log function like base.logger(), if you blackbox base.js and call base.logger() from app.js, the console log shows the source file and line from app.js
The blackboxing is also applied in the Chrome network panel, Chrome has an extra initiator column which shows which file and line number triggered the network request. FF has the stack trace in the network panel, request detail view, but as stack trace doesn't exclude blackboxed files, you see all the various libraries which can be pretty verbose
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.