Last change
on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
605 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | const RollingFileWriteStream = require('./RollingFileWriteStream');
|
---|
| 2 |
|
---|
| 3 | // just to adapt the previous version
|
---|
| 4 | class RollingFileStream extends RollingFileWriteStream {
|
---|
| 5 | constructor(filename, size, backups, options) {
|
---|
| 6 | if (!options) {
|
---|
| 7 | options = {};
|
---|
| 8 | }
|
---|
| 9 | if (size) {
|
---|
| 10 | options.maxSize = size;
|
---|
| 11 | }
|
---|
| 12 | if (!backups) {
|
---|
| 13 | backups = 1;
|
---|
| 14 | }
|
---|
| 15 | options.numToKeep = backups;
|
---|
| 16 | super(filename, options);
|
---|
| 17 | this.backups = this.options.numToKeep;
|
---|
| 18 | this.size = this.options.maxSize;
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | get theStream() {
|
---|
| 22 | return this.currentFileStream;
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | module.exports = RollingFileStream;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.