projecte_ionic/node_modules/streamroller/lib/RollingFileStream.js
2022-02-09 18:30:03 +01:00

28 lines
605 B
JavaScript
Executable file

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;