Media/WebRTC/Logging: Difference between revisions

Remove more outdated information
(Remove out of date information.)
(Remove more outdated information)
Line 2: Line 2:


=== Note about NSPR and MOZ_LOG ===
=== Note about NSPR and MOZ_LOG ===
NSPR has been deprecated in favor of [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Gecko_Logging MOZ_LOG].
NSPR (NSPR_LOG_MODULES) has been deprecated in favor of [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Gecko_Logging MOZ_LOG]. NSPR_LOG_MODULES does not work with the libwebrtc logging, so just use MOZ_LOG.
However, these are two parallel logging systems and some webrtc code still uses NSPR. Before Firefox 54, the MOZ_LOG* variables can not be used to control all webrtc logging (in particular 'signaling' and 'webrtc_trace' can't).  From 54 and later, MOZ_LOG can be used for all logging.  Note also that MOZ_LOG is case-sensitive, while NSPR_LOG_MODULES is not.


In Firefox 54 and later, you can use about:networking, and select the Logging option, to change MOZ_LOG/MOZ_LOG_FILE options on the fly -- without restarting the browser.  Also, you can use about:config and set any log option by adding a "logging.xxxxx" variable (right-click -> New), and set it to an integer value of 0-5.
In Firefox 54 and later, you can use about:networking, and select the Logging option, to change MOZ_LOG/MOZ_LOG_FILE options on the fly -- without restarting the browser.  Also, you can use about:config and set any log option by adding a "logging.xxxxx" variable (right-click -> New), and set it to an integer value of 0-5.
Line 16: Line 15:
=== Signaling (SDP offer/answer handling) ===
=== Signaling (SDP offer/answer handling) ===


This uses the normal Mozilla [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/Logging NSPR logging] infrastructure, which uses a comma-separated list of modules, each one with its indicated [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_LOG_MODULES NSPR log level]. For WebRTC, you'll be most interested in
This uses the normal Mozilla [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Gecko_Logging MOZ_LOG] infrastructure, which uses a comma-separated list of modules, each one with its indicated [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Gecko_Logging MOZ log level]. For WebRTC, you'll be most interested in
* NSPR_LOG_MODULES=signaling:5,mtransport:5
* MOZ_LOG=signaling:5,mtransport:5
* NSPR_LOG_FILE=/path/to/nspr.log (if you don't want the default stderr)
* MOZ_LOG_FILE=/path/to/moz.log (if you don't want the default stderr)


You can also add ",timestamp" to that list if you want each log message to include timestamps. Other options are available as well, and they are detailed under "Description" on the [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_LOG_MODULES NSPR LOG MODULES] MDN page.
You can also add ",timestamp" to that list if you want each log message to include timestamps. Other options are available as well, and they are detailed under "Description" on the [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Gecko_Logging MOZ LOG MODULES] MDN page.


=== getUserMedia and others ===
=== getUserMedia and others ===
To log getUserMedia stuff, use NSPR_LOG_MODULES=MediaManager:4,GetUserMedia:4.  For frame-by-frame logging, use MediaManager:5
To log getUserMedia stuff, use MOZ_LOG=MediaManager:4,GetUserMedia:4.  For frame-by-frame logging, use MediaManager:5
Camera-specific logging modules: CamerasParent and CamerasChild
Camera-specific logging modules: CamerasParent and CamerasChild
DOMMediaStreams: MediaStream
DOMMediaStreams: MediaStream
4

edits