corrected log messages

This commit is contained in:
Daniel Sommer 2022-04-25 16:22:18 +02:00
parent 4449b8cc9c
commit 087698df8c

View file

@ -63,11 +63,11 @@ class Player extends EventEmitter {
if (this.buffer.announced === undefined && this.buffer.size >= this.buffer.threshold) { if (this.buffer.announced === undefined && this.buffer.size >= this.buffer.threshold) {
this.buffer.announced = true; this.buffer.announced = true;
this.#setState(constants.STATE_READY); this.#setState(constants.STATE_READY);
logger.debug('threshold of ' + this.buffer.threshold + ' bytes reached after ' + (Date.now() - this.timestamp) + 'ms'); logger.debug('buffer threshold of ' + this.buffer.threshold + ' bytes reached after ' + (Date.now() - this.timestamp) + 'ms');
} }
if (this.buffer.size >= this.buffer.limit) { if (this.buffer.size >= this.buffer.limit) {
logger.debug('buffer limit of ' + this.buffer.limit + ' bytes reached, pausing read stream...');
this.stream.pause(); this.stream.pause();
logger.warn('BUFFER LIMIT REACHED - PAUSING STREAM');
} }
}); });
} }
@ -83,7 +83,7 @@ class Player extends EventEmitter {
this.buffer.size -= tmp.length; this.buffer.size -= tmp.length;
this.speaker.write(tmp); this.speaker.write(tmp);
if (this.buffer.size < this.buffer.limit) { if (this.buffer.size < this.buffer.limit) {
logger.warn('BUFFER UNDERRUN - RESUMING STREAM'); logger.debug('fell below buffer limit of ' + this.buffer.limit + ' bytes, resuming read stream...');
this.stream.resume(); this.stream.resume();
} }
} }