浏览代码

fix(RTC): Fix log formatting

dev1
Jaya Allamsetty 5 年前
父节点
当前提交
3bfdb98e3b
共有 2 个文件被更改,包括 6 次插入10 次删除
  1. 1
    1
      modules/RTC/RTC.js
  2. 5
    9
      modules/RTC/RTCUtils.js

+ 1
- 1
modules/RTC/RTC.js 查看文件

@@ -349,7 +349,7 @@ export default class RTC extends Listenable {
349 349
      * @private
350 350
      */
351 351
     _senderVideoConstraintsChanged(senderVideoConstraints) {
352
-        logger.info(`Received remote max frame height of ${senderVideoConstraints} on the bridge channel`);
352
+        logger.info('Remote max frame height received on bridge channel: ', JSON.stringify(senderVideoConstraints));
353 353
         this._senderVideoConstraints = senderVideoConstraints;
354 354
         this.eventEmitter.emit(RTCEvents.SENDER_VIDEO_CONSTRAINTS_CHANGED);
355 355
     }

+ 5
- 9
modules/RTC/RTCUtils.js 查看文件

@@ -659,9 +659,7 @@ function updateKnownDevices(pds) {
659 659
  */
660 660
 function onMediaDevicesListChanged(devicesReceived) {
661 661
     availableDevices = devicesReceived.slice(0);
662
-    logger.info(
663
-        'list of media devices has changed:',
664
-        availableDevices);
662
+    logger.info('list of media devices has changed:', availableDevices);
665 663
 
666 664
     sendDeviceListToAnalytics(availableDevices);
667 665
 
@@ -987,7 +985,7 @@ class RTCUtils extends Listenable {
987 985
     getUserMediaWithConstraints(um, options = {}) {
988 986
         const constraints = getConstraints(um, options);
989 987
 
990
-        logger.info('Get media constraints', constraints);
988
+        logger.info('Get media constraints', JSON.stringify(constraints));
991 989
 
992 990
         return new Promise((resolve, reject) => {
993 991
             navigator.mediaDevices.getUserMedia(constraints)
@@ -997,8 +995,7 @@ class RTCUtils extends Listenable {
997 995
                 resolve(stream);
998 996
             })
999 997
             .catch(error => {
1000
-                logger.warn('Failed to get access to local media. '
1001
-                    + ` ${error} ${constraints} `);
998
+                logger.warn(`Failed to get access to local media. ${error} ${JSON.stringify(constraints)}`);
1002 999
                 updateGrantedPermissions(um, undefined);
1003 1000
                 reject(new JitsiTrackError(error, constraints, um));
1004 1001
             });
@@ -1022,8 +1019,7 @@ class RTCUtils extends Listenable {
1022 1019
                     resolve(stream);
1023 1020
                 })
1024 1021
                 .catch(error => {
1025
-                    logger.warn('Failed to get access to local media. '
1026
-                        + ` ${error} ${constraints} `);
1022
+                    logger.warn(`Failed to get access to local media. ${error} ${JSON.stringify(constraints)}`);
1027 1023
                     updateGrantedPermissions(umDevices, undefined);
1028 1024
                     reject(new JitsiTrackError(error, constraints, umDevices));
1029 1025
                 });
@@ -1382,7 +1378,7 @@ class RTCUtils extends Listenable {
1382 1378
             const constraints = newGetConstraints(
1383 1379
                 requestedCaptureDevices, options);
1384 1380
 
1385
-            logger.info('Got media constraints: ', constraints);
1381
+            logger.info('Got media constraints: ', JSON.stringify(constraints));
1386 1382
 
1387 1383
             return this._newGetUserMediaWithConstraints(
1388 1384
                 requestedCaptureDevices, constraints);

正在加载...
取消
保存