浏览代码

improve logging

release-8443
Andrei Gavrilescu 6 年前
父节点
当前提交
5e9075ba10
共有 3 个文件被更改,包括 22 次插入9 次删除
  1. 8
    0
      modules/RTC/JitsiTrack.js
  2. 12
    2
      modules/detection/TrackVADEmitter.js
  3. 2
    7
      modules/detection/VADTalkMutedDetection.js

+ 8
- 0
modules/RTC/JitsiTrack.js 查看文件

230
         return this.track;
230
         return this.track;
231
     }
231
     }
232
 
232
 
233
+    /**
234
+     * Return the underlying WebRTC MediaStreamTrack label
235
+     * @returns {string}
236
+     */
237
+    getTrackLabel() {
238
+        return this.track.label;
239
+    }
240
+
233
     /**
241
     /**
234
      * Returns the ID of the underlying WebRTC MediaStreamTrack(if any)
242
      * Returns the ID of the underlying WebRTC MediaStreamTrack(if any)
235
      * @returns {String|null}
243
      * @returns {String|null}

+ 12
- 2
modules/detection/TrackVADEmitter.js 查看文件

178
     }
178
     }
179
 
179
 
180
     /**
180
     /**
181
-     * Cleanup potentially acquired resources.
181
+     * Get the associated track device ID.
182
      *
182
      *
183
-     * @returns {void}
183
+     * @returns {string}
184
      */
184
      */
185
     getDeviceId() {
185
     getDeviceId() {
186
         return this._localTrack.getDeviceId();
186
         return this._localTrack.getDeviceId();
187
     }
187
     }
188
 
188
 
189
+
190
+    /**
191
+     * Get the associated track label.
192
+     *
193
+     * @returns {string}
194
+     */
195
+    getTrackLabel() {
196
+        return this._localTrack.getDeviceLabel();
197
+    }
198
+
189
     /**
199
     /**
190
      * Start the emitter by connecting the audio graph.
200
      * Start the emitter by connecting the audio graph.
191
      *
201
      *

+ 2
- 7
modules/detection/VADTalkMutedDetection.js 查看文件

116
      * @returns {void}
116
      * @returns {void}
117
      */
117
      */
118
     _startVADEmitter() {
118
     _startVADEmitter() {
119
-        logger.info('Starting VAD Emitter for track', this._vadEmitter.getDeviceId());
120
         this._vadEmitter.on(VAD_SCORE_PUBLISHED, this._processVADScore.bind(this));
119
         this._vadEmitter.on(VAD_SCORE_PUBLISHED, this._processVADScore.bind(this));
121
         this._vadEmitter.start();
120
         this._vadEmitter.start();
122
     }
121
     }
126
      * @returns {void}
125
      * @returns {void}
127
      */
126
      */
128
     _stopVADEmitter() {
127
     _stopVADEmitter() {
129
-        logger.info('Stopping VAD Emitter for track', this._vadEmitter.getDeviceId());
130
         this._vadEmitter.removeAllListeners(VAD_SCORE_PUBLISHED);
128
         this._vadEmitter.removeAllListeners(VAD_SCORE_PUBLISHED);
131
         this._vadEmitter.stop();
129
         this._vadEmitter.stop();
132
     }
130
     }
166
              */
164
              */
167
             this.emit(VAD_TALK_WHILE_MUTED, {});
165
             this.emit(VAD_TALK_WHILE_MUTED, {});
168
 
166
 
169
-            logger.info('Triggered event for track: ', this._vadEmitter.getDeviceId());
170
-
171
             // Event was fired. Stop event emitter and remove listeners so no residue events kick off after this point
167
             // Event was fired. Stop event emitter and remove listeners so no residue events kick off after this point
172
             // and a single VAD_TALK_WHILE_MUTED is generated per mic muted state.
168
             // and a single VAD_TALK_WHILE_MUTED is generated per mic muted state.
173
             this._stopVADEmitter();
169
             this._stopVADEmitter();
240
                     TrackVADEmitter.create(track.getDeviceId(), VAD_EMITTER_SAMPLE_RATE, vadProcessor)
236
                     TrackVADEmitter.create(track.getDeviceId(), VAD_EMITTER_SAMPLE_RATE, vadProcessor)
241
                 )
237
                 )
242
                 .then(vadEmitter => {
238
                 .then(vadEmitter => {
243
-                    logger.info('Created VAD emitter for track: ', track.getDeviceId());
239
+                    logger.debug('Created VAD emitter for track: ', track.getTrackLabel());
244
 
240
 
245
                     this._vadEmitter = vadEmitter;
241
                     this._vadEmitter = vadEmitter;
246
 
242
 
263
         if (this._isLocalAudioTrack(track)) {
259
         if (this._isLocalAudioTrack(track)) {
264
             // On a mute toggle reset the state.
260
             // On a mute toggle reset the state.
265
             this._vadInitTracker.then(() => {
261
             this._vadInitTracker.then(() => {
266
-                logger.info('Changing track: ', track.getDeviceId(), ' muted status to:', track.isMuted());
267
 
262
 
268
                 // Reset the processing context in between muted states so that each individual mute phase can generate
263
                 // Reset the processing context in between muted states so that each individual mute phase can generate
269
                 // it's own event.
264
                 // it's own event.
289
         if (this._isLocalAudioTrack(track)) {
284
         if (this._isLocalAudioTrack(track)) {
290
             // Use the promise to make sure operations are in sequence.
285
             // Use the promise to make sure operations are in sequence.
291
             this._vadInitTracker.then(() => {
286
             this._vadInitTracker.then(() => {
292
-                logger.info('Removing track from VAD detection - ', track.getDeviceId());
287
+                logger.debug('Removing track from VAD detection - ', track.getTrackLabel());
293
 
288
 
294
                 if (this._vadEmitter) {
289
                 if (this._vadEmitter) {
295
                     this._stopVADEmitter();
290
                     this._stopVADEmitter();

正在加载...
取消
保存