Selaa lähdekoodia

improve logging

release-8443
Andrei Gavrilescu 6 vuotta sitten
vanhempi
commit
5e9075ba10

+ 8
- 0
modules/RTC/JitsiTrack.js Näytä tiedosto

@@ -230,6 +230,14 @@ export default class JitsiTrack extends EventEmitter {
230 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 242
      * Returns the ID of the underlying WebRTC MediaStreamTrack(if any)
235 243
      * @returns {String|null}

+ 12
- 2
modules/detection/TrackVADEmitter.js Näytä tiedosto

@@ -178,14 +178,24 @@ export default class TrackVADEmitter extends EventEmitter {
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 185
     getDeviceId() {
186 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 200
      * Start the emitter by connecting the audio graph.
191 201
      *

+ 2
- 7
modules/detection/VADTalkMutedDetection.js Näytä tiedosto

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

Loading…
Peruuta
Tallenna