Browse Source

Removes deprecated applicationLog, replaces it with applicationLog.

master
damencho 9 years ago
parent
commit
f2817b9c42
3 changed files with 12 additions and 33 deletions
  1. 1
    1
      JitsiConference.js
  2. 5
    6
      modules/statistics/CallStats.js
  3. 6
    26
      modules/statistics/statistics.js

+ 1
- 1
JitsiConference.js View File

1355
         if (conference.isModerator()) {
1355
         if (conference.isModerator()) {
1356
             conference.on(JitsiConferenceEvents.RECORDER_STATE_CHANGED,
1356
             conference.on(JitsiConferenceEvents.RECORDER_STATE_CHANGED,
1357
                 function (status, error) {
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 View File

20
     getUserMedia:         "getUserMedia",
20
     getUserMedia:         "getUserMedia",
21
     iceConnectionFailure: "iceConnectionFailure",
21
     iceConnectionFailure: "iceConnectionFailure",
22
     signalingError:       "signalingError",
22
     signalingError:       "signalingError",
23
-    applicationError:     "applicationError"
23
+    applicationLog:       "applicationLog"
24
 };
24
 };
25
 
25
 
26
 /**
26
 /**
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
  * @param {CallStats} cs callstats instance related to the error (optional)
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
     CallStats._reportError
460
     CallStats._reportError
462
-        .call(cs, wrtcFuncNames.applicationError, e, null);
461
+        .call(cs, wrtcFuncNames.applicationLog, e, null);
463
 });
462
 });
464
 
463
 
465
 module.exports = CallStats;
464
 module.exports = CallStats;

+ 6
- 26
modules/statistics/statistics.js View File

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
     if (Statistics.callsStatsInstances.length) {
372
     if (Statistics.callsStatsInstances.length) {
373
         Statistics.callsStatsInstances.forEach(function (cs) {
373
         Statistics.callsStatsInstances.forEach(function (cs) {
374
-            CallStats.sendUnhandledError(e, cs);
374
+            CallStats.sendApplicationLog(m, cs);
375
         });
375
         });
376
     } else {
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
  * Sends the given feedback through CallStats.
382
  * Sends the given feedback through CallStats.
403
  *
383
  *
420
     if (error instanceof JitsiTrackError && error.gum) {
400
     if (error instanceof JitsiTrackError && error.gum) {
421
         Statistics.sendGetUserMediaFailed(error);
401
         Statistics.sendGetUserMediaFailed(error);
422
     } else {
402
     } else {
423
-        Statistics.sendUnhandledError(error);
403
+        Statistics.sendLog(error);
424
     }
404
     }
425
 };
405
 };
426
 
406
 

Loading…
Cancel
Save