winston-daily-rotate-file
Advanced tools
Comparing version 3.8.0 to 3.9.0
@@ -94,2 +94,6 @@ 'use strict'; | ||
this.logStream.on('new', function (newFile) { | ||
self.emit('new', newFile); | ||
}); | ||
this.logStream.on('rotate', function (oldFile, newFile) { | ||
@@ -96,0 +100,0 @@ self.emit('rotate', oldFile, newFile); |
{ | ||
"name": "winston-daily-rotate-file", | ||
"version": "3.8.0", | ||
"version": "3.9.0", | ||
"description": "A transport for winston which logs to a rotating file each day.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -54,3 +54,3 @@ # winston-daily-rotate-file | ||
You can listen for the *rotate* custom event. The rotate event will pass two parameters to the callback (*oldFilename*, *newFilename*). You can also listen for the *archive* custom event. The archive event will pass one parameter to the callback (*zipFilename*). | ||
This transport emits three custom events: *new*, *rotate*, and *archive*. You can listen for the *new* custom event, which is fired when a new log file is created. The new event will pass one parameter to the callback (*newFilename*). You can listen for the *rotate* custom event, which is fired when the log file is rotated. The rotate event will pass two parameters to the callback (*oldFilename*, *newFilename*). You can also listen for the *archive* custom event, which is fired when the log file is archived. The archive event will pass one parameter to the callback (*zipFilename*). | ||
@@ -57,0 +57,0 @@ ## LICENSE |
@@ -153,2 +153,12 @@ /* eslint-disable max-nested-callbacks,no-unused-expressions,handle-callback-err */ | ||
it('should raise the new event for a new log file', function (done) { | ||
this.transport.on('new', function (newFile) { | ||
expect(newFile).to.equal(filename); | ||
done(); | ||
}); | ||
sendLogItem(this.transport, 'info', 'this message should write to the file'); | ||
this.transport.close(); | ||
}); | ||
describe('when setting zippedArchive', function () { | ||
@@ -238,3 +248,2 @@ it('should archive the log after rotating', function (done) { | ||
}); | ||
this.transport.close(); | ||
}); | ||
@@ -241,0 +250,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30358
579