Changeset 238601 in webkit


Ignore:
Timestamp:
Nov 27, 2018 8:48:30 PM (5 years ago)
Author:
youenn@apple.com
Message:

Log WebRTC stats in inspector console only when setting is verbose
https://bugs.webkit.org/show_bug.cgi?id=192014

Reviewed by Eric Carlson.

Add a WebRTCStats channel that is used by default to output WebRTC stats in console.
When WebRTC Debug logging is enabled, log WebRTC stats in WebRTC channel,
so that they appear as debug information in Web Inspector.

No change of JS behavior.
Covered by manually testing what is logged in inspector and console.

  • Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:

(WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):

  • platform/Logging.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r238600 r238601  
     12018-11-27  Youenn Fablet  <youenn@apple.com>
     2
     3        Log WebRTC stats in inspector console only when setting is verbose
     4        https://bugs.webkit.org/show_bug.cgi?id=192014
     5
     6        Reviewed by Eric Carlson.
     7
     8        Add a WebRTCStats channel that is used by default to output WebRTC stats in console.
     9        When WebRTC Debug logging is enabled, log WebRTC stats in WebRTC channel,
     10        so that they appear as debug information in Web Inspector.
     11
     12        No change of JS behavior.
     13        Covered by manually testing what is logged in inspector and console.
     14
     15        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
     16        (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
     17        * platform/Logging.h:
     18
    1192018-11-27  Simon Fraser  <simon.fraser@apple.com>
    220
  • trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp

    r238182 r238601  
    855855        }
    856856
    857         for (auto iterator = report->begin(); iterator != report->end(); ++iterator)
    858             ALWAYS_LOG(Logger::LogSiteIdentifier("LibWebRTCMediaEndpoint", "OnStatsDelivered", logIdentifier()), RTCStatsLogger { *iterator });
     857        for (auto iterator = report->begin(); iterator != report->end(); ++iterator) {
     858            if (logger().willLog(logChannel(), WTFLogLevelDebug)) {
     859                // Stats are very verbose, let's only display them in inspector console in verbose mode.
     860                logger().debug(LogWebRTC,
     861                    Logger::LogSiteIdentifier("LibWebRTCMediaEndpoint", "OnStatsDelivered", logIdentifier()),
     862                    RTCStatsLogger { *iterator });
     863            } else {
     864                logger().logAlways(LogWebRTCStats,
     865                    Logger::LogSiteIdentifier("LibWebRTCMediaEndpoint", "OnStatsDelivered", logIdentifier()),
     866                    RTCStatsLogger { *iterator });
     867            }
     868        }
    859869    });
    860870#else
  • trunk/Source/WebCore/platform/Logging.h

    r237723 r238601  
    104104    M(WebMetal) \
    105105    M(WebRTC) \
     106    M(WebRTCStats) \
    106107    M(WheelEventTestTriggers) \
    107108
Note: See TracChangeset for help on using the changeset viewer.