Open Bug 1617441 Opened 5 years ago Updated 2 years ago

Output bfcache log messages to DevTools' console

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

enhancement

Tracking

()

UNCONFIRMED

People

(Reporter: vkhomyackov, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36

Steps to reproduce:

The code in Document::CanSavePresentation outputs explaining messages in MOZ_LOG in the case when a page cannot be saved to bfcache, e.g. at line https://dxr.mozilla.org/mozilla-central/rev/bd65ac107627408a01cf1faf62e59665ba37cf20/dom/base/Document.cpp#10375

  MOZ_LOG(gPageCacheLog, mozilla::LogLevel::Verbose,
          ("Save of %s blocked due to unload handlers", uri.get()));

Actual results:

Messages are written to the log file when there are corresponding environment variables or command-line arguments. In order to see these messages right now, developers must be aware of their existence and must run Firefox with corresponding settings.

Expected results:

As a frontend developer, I'd like to see the same messages in DevTools' console. This would have following benefits:

  • this way of reporting various errors and warnings is already familiar to developers
  • more developers will be aware of bfcache
  • developing and supporting bfcache-friendly pages will be much easier

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Console
Product: Firefox → DevTools
OS: Unspecified → All
Hardware: Unspecified → All
Component: Console → DOM: Core & HTML
Product: DevTools → Core

This may actually be an useful feature beyond only bfcache related logs.

We would need a way to know what log module names are being currently used.
And console codebase should probably try to read the log files as that's sounds hard to be notified about each individual log without threading/re-entrance issues.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.