Closed Bug 1810498 Opened 3 years ago Closed 2 years ago

Hook up webrtc_trace logs to MOZ_LOG by default

Categories

(Core :: WebRTC, task, P3)

task

Tracking

()

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: pehrsons, Assigned: pehrsons)

References

Details

Attachments

(6 files)

Currently to get webrtc logs through MOZ_LOG one has to enable the webrtc_trace log module, and on about:webrtc click "Start Debug Mode".

The step that requires about:webrtc is unnecessary friction. It seems possible to avoid this.

We should override these methods in our log sink and call StartWebrtcLog automatically if the correct log module is enabled, and if its level changes.

Blocks: 1818611

Most of that seems straight forward. What about the case where webrtrc_trace transitions from enabled, to disabled, and back to enabled? When we disable the underlying libwebrtc logger we won't get log messages from libwebrtc, and then won't be able to check the log level of the gecko log module. LazyLogModule is final.

If it changes on the fly it must have been set by pref, and in that case we can listen to changes to that pref. The pref being "logging.webrtc_trace".
Either that or we could invent a way in which LogModule can tell us its configuration changed.

We need to be able to observe the LogModule's level so that we can adjust libwebrtc's log level to match. This seems like a problem that would be common to log adapters to systems which do not delegate the decision of whether or not a particular log line is executed. Perhaps it would be better if libwebrtc's logging system did that.

On monitoring a pref: https://searchfox.org/mozilla-central/rev/44a7ece8626d9bc418da7d13341f9163817d199b/modules/libpref/Preferences.h#234 looks promising.

Assignee: nobody → apehrson
Status: NEW → ASSIGNED
Pushed by pehrsons@gmail.com: https://hg.mozilla.org/integration/autoland/rev/81bd1fa30409 Don't set webrtc_trace log level from about:webrtc. r=ng,webidl,farre https://hg.mozilla.org/integration/autoland/rev/4241d91898c9 Keep track of the number of users of webrtc logging. r=ng https://hg.mozilla.org/integration/autoland/rev/b381dba39ad8 Remove unused includes in webrtc/common/*, webrtc/jsapi/PeerConnectionCtx.* and webrtc/jsapi/WebrtcGlobal*. r=webrtc-reviewers,ng https://hg.mozilla.org/integration/autoland/rev/8d90c964a807 Enable webrtc logging from CamerasParent (parent process). r=ng https://hg.mozilla.org/integration/autoland/rev/b4ec0e2be337 Update WebRTC log sink on webrtc_trace logging pref changes. r=ng https://hg.mozilla.org/integration/autoland/rev/fdee7bc5d06a Forward severity properly to MOZ_LOG. r=ng
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: