blob: ec794c33ceae1c64c9ba36c12c50de3260b72bbd [file] [log] [blame]
const RollingFileWriteStream = require('./RollingFileWriteStream');
// just to adapt the previous version
class RollingFileStream extends RollingFileWriteStream {
constructor(filename, size, backups, options) {
if (!options) {
options = {};
}
if (size) {
options.maxSize = size;
}
if (!backups) {
backups = 1;
}
options.numToKeep = backups;
super(filename, options);
this.backups = this.options.numToKeep;
this.size = this.options.maxSize;
}
get theStream() {
return this.currentFileStream;
}
}
module.exports = RollingFileStream;