bunyan-rotating-file-stream
Advanced tools
Comparing version 1.6.3 to 2.0.0
# bunyan Changelog | ||
## 2.0.0 | ||
- Refreshing node versions - now only supports nodejs v14+ | ||
- Bump dependencies to latest versions | ||
- Update lib/filerotator.js | ||
- Emit gzip_finish event | ||
- Removing redundant bunyan dependency | ||
- Check for undefined mtime | ||
## 1.6.1 | ||
@@ -4,0 +13,0 @@ |
@@ -92,5 +92,10 @@ var fs = require('fs'); | ||
function filterUnstattedFiles(logstats, next) { | ||
filteredlogstats = logstats.filter(logstat => logstat && logstat.stat && logstat.stat.mtime); | ||
next(null, filteredlogstats); | ||
} | ||
function sortFilesByModifiedTime(logstats, next) { | ||
async.sortBy(logstats, function (logstat, next) { | ||
next(null, -logstat.stat.mtime); | ||
next(null, -logstat?.stat?.mtime); | ||
}, next); | ||
@@ -145,2 +150,3 @@ } | ||
statEachFile, | ||
filterUnstattedFiles, | ||
sortFilesByModifiedTime | ||
@@ -147,0 +153,0 @@ ], function (err, logfiles) { |
@@ -48,4 +48,8 @@ 'use strict'; | ||
.pipe(fs.createWriteStream(zippedPath)) | ||
.on('finish', function () { | ||
fs.unlink(unzippedPath, next); | ||
.on('close', function () { | ||
fs.unlink(unzippedPath, () => { | ||
base.emit('gzip_finish', zippedPath); | ||
next(); | ||
}); | ||
}) | ||
@@ -52,0 +56,0 @@ } |
@@ -89,3 +89,3 @@ 'use strict'; | ||
queue.drain = function () { | ||
queue.drain(function () { | ||
if (throwLogsAway) { | ||
@@ -116,3 +116,3 @@ var notification = { | ||
} | ||
} | ||
}) | ||
@@ -119,0 +119,0 @@ function isEmpty() { |
@@ -18,4 +18,2 @@ /* global Buffer */ | ||
var bunyan = require('bunyan'); | ||
var _DEBUG = false; | ||
@@ -122,3 +120,3 @@ | ||
var writeBuffer = new Buffer(str, 'utf8'); | ||
var writeBuffer = new Buffer.from(str, 'utf8'); | ||
@@ -189,2 +187,6 @@ var emitinfo = { | ||
rotator.on('gzip_finish', function(zippedPath) { | ||
base.emit('gzip_finish', zippedPath); | ||
}); | ||
function initialise() { | ||
@@ -191,0 +193,0 @@ rotator.initialise(options.startNewFile, function (err) { |
{ | ||
"name": "bunyan-rotating-file-stream", | ||
"version": "1.6.3", | ||
"version": "2.0.0", | ||
"description": "a rotating file stream for the bunyan logging system", | ||
@@ -12,5 +12,5 @@ "author": "Jim Tupper <npm@tupper.org.uk> (http://github.com/rcomian)", | ||
}, | ||
"engines": [ | ||
"node >=0.10.0" | ||
], | ||
"engines": { | ||
"node": ">=14.17.0" | ||
}, | ||
"keywords": [ | ||
@@ -27,16 +27,15 @@ "log", | ||
"devDependencies": { | ||
"logzio-nodejs": "logzio/logzio-nodejs", | ||
"bunyan": "^1.7.1", | ||
"js-combinatorics": "^0.5.0", | ||
"mkdirp": "^0.5.1", | ||
"rmdir": "^1.1.0", | ||
"uuid": "^2.0.1", | ||
"why-is-node-running": "^1.2.1" | ||
"bunyan": "^1.8.15", | ||
"fs-extra": "^10.0.0", | ||
"js-combinatorics": "^1.4.5", | ||
"logzio-nodejs": "^2.0.2", | ||
"uuid": "^8.3.2", | ||
"why-is-node-running": "^2.2.0" | ||
}, | ||
"dependencies": { | ||
"async": "^1.5.2", | ||
"lodash": "^4.2.1", | ||
"semver": "^5.1.0", | ||
"strftime": "^0.9.2" | ||
"async": "^3.2.0", | ||
"lodash": "^4.17.21", | ||
"semver": "^7.3.5", | ||
"strftime": "^0.10.0" | ||
} | ||
} |
@@ -24,2 +24,7 @@ Bunyan Rotating File Stream is a stream component for the logging system "node bunyan" that provides rich and flexible control over your log files. | ||
## 2.0.0 Version refresh | ||
Updated dependencies and engine support (now v14+). This will allow me to refactor using the latest javascript syntax. | ||
Minor enhancements and stability fixes (see changelog). | ||
## 1.6.3 Type definition file for Typescript | ||
@@ -26,0 +31,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
175046
6
3468
386
26
+ Addedasync@3.2.5(transitive)
+ Addedsemver@7.6.2(transitive)
+ Addedstrftime@0.10.2(transitive)
- Removedasync@1.5.2(transitive)
- Removedsemver@5.7.2(transitive)
- Removedstrftime@0.9.2(transitive)
Updatedasync@^3.2.0
Updatedlodash@^4.17.21
Updatedsemver@^7.3.5
Updatedstrftime@^0.10.0