Parcourir la source

Removes deprecated applicationLog, replaces it with applicationLog.

master
damencho il y a 9 ans
Parent
révision
f2817b9c42
3 fichiers modifiés avec 12 ajouts et 33 suppressions
  1. 1
    1
      JitsiConference.js
  2. 5
    6
      modules/statistics/CallStats.js
  3. 6
    26
      modules/statistics/statistics.js

+ 1
- 1
JitsiConference.js Voir le fichier

@@ -1355,7 +1355,7 @@ function setupListeners(conference) {
1355 1355
         if (conference.isModerator()) {
1356 1356
             conference.on(JitsiConferenceEvents.RECORDER_STATE_CHANGED,
1357 1357
                 function (status, error) {
1358
-                    conference.statistics.sendLog("Recorder: " + status);
1358
+                    Statistics.sendLog("Recorder: " + status);
1359 1359
                 });
1360 1360
         }
1361 1361
 

+ 5
- 6
modules/statistics/CallStats.js Voir le fichier

@@ -20,7 +20,7 @@ var wrtcFuncNames = {
20 20
     getUserMedia:         "getUserMedia",
21 21
     iceConnectionFailure: "iceConnectionFailure",
22 22
     signalingError:       "signalingError",
23
-    applicationError:     "applicationError"
23
+    applicationLog:       "applicationLog"
24 24
 };
25 25
 
26 26
 /**
@@ -451,15 +451,14 @@ CallStats.sendAddIceCandidateFailed = _try_catch(function (e, pc, cs) {
451 451
 });
452 452
 
453 453
 /**
454
- * Notifies CallStats that there is an unhandled error on the page.
454
+ * Notifies CallStats that there is a log we want to report.
455 455
  *
456
- * @param {Error} e error to send
457
- * @param {RTCPeerConnection} pc connection on which failure occured.
456
+ * @param {Error} e error to send or {String} message
458 457
  * @param {CallStats} cs callstats instance related to the error (optional)
459 458
  */
460
-CallStats.sendUnhandledError = _try_catch(function (e, cs) {
459
+CallStats.sendApplicationLog = _try_catch(function (e, cs) {
461 460
     CallStats._reportError
462
-        .call(cs, wrtcFuncNames.applicationError, e, null);
461
+        .call(cs, wrtcFuncNames.applicationLog, e, null);
463 462
 });
464 463
 
465 464
 module.exports = CallStats;

+ 6
- 26
modules/statistics/statistics.js Voir le fichier

@@ -364,40 +364,20 @@ Statistics.prototype.sendAddIceCandidateFailed = function (e, pc) {
364 364
 };
365 365
 
366 366
 /**
367
- * Notifies CallStats that there is unhandled exception.
367
+ * Adds to CallStats an application log.
368 368
  *
369
- * @param {Error} e error to send
369
+ * @param {String} a log message to send or an {Error} object to be reported
370 370
  */
371
-Statistics.sendUnhandledError = function (e) {
371
+Statistics.sendLog = function (m) {
372 372
     if (Statistics.callsStatsInstances.length) {
373 373
         Statistics.callsStatsInstances.forEach(function (cs) {
374
-            CallStats.sendUnhandledError(e, cs);
374
+            CallStats.sendApplicationLog(m, cs);
375 375
         });
376 376
     } else {
377
-        CallStats.sendUnhandledError(e, null);
377
+        CallStats.sendApplicationLog(m, null);
378 378
     }
379 379
 };
380 380
 
381
-/**
382
- * Adds to CallStats an application log.
383
- *
384
- * @param {String} a log message to send
385
- */
386
-Statistics.sendLog = function (m) {
387
-    // uses  the same field for cs stat as unhandled error
388
-    Statistics.sendUnhandledError(m);
389
-};
390
-
391
-/**
392
- * Adds to CallStats an application log.
393
- *
394
- * @param {String} a log message to send
395
- */
396
-Statistics.prototype.sendLog = function (m) {
397
-    // uses  the same field for cs stat as unhandled error
398
-    CallStats.sendUnhandledError(m, this.callstats);
399
-};
400
-
401 381
 /**
402 382
  * Sends the given feedback through CallStats.
403 383
  *
@@ -420,7 +400,7 @@ Statistics.reportGlobalError = function (error) {
420 400
     if (error instanceof JitsiTrackError && error.gum) {
421 401
         Statistics.sendGetUserMediaFailed(error);
422 402
     } else {
423
-        Statistics.sendUnhandledError(error);
403
+        Statistics.sendLog(error);
424 404
     }
425 405
 };
426 406
 

Chargement…
Annuler
Enregistrer