Comparing version 1.2.2 to 1.2.3
@@ -9,2 +9,9 @@ # bunyan Changelog | ||
## bunyan 1.2.3 | ||
- [issue #184] Fix log rotation for rotation periods > ~25 days. Before this | ||
change, a rotation period longer than this could hit [the maximum setTimeout | ||
delay in node.js](https://github.com/joyent/node/issues/8656). By Daniel Juhl. | ||
## bunyan 1.2.2 | ||
@@ -35,4 +42,4 @@ | ||
*not* emitted by default (use `V=1 npm install` to see it); instead a | ||
short warning is emitted if the build fails. | ||
short warning is emitted if the build fails. | ||
Also, importantly, the new dtrace-provider fixes working with node | ||
@@ -39,0 +46,0 @@ v0.11/0.12. |
@@ -11,3 +11,3 @@ /** | ||
var VERSION = '1.2.2'; | ||
var VERSION = '1.2.3'; | ||
@@ -1086,5 +1086,12 @@ // Bunyan log format version. This becomes the 'v' field on all log records. | ||
this.rotAt = this._nextRotTime(); | ||
var delay = this.rotAt - Date.now(); | ||
// Cap timeout to Node's max setTimeout, see | ||
// <https://github.com/joyent/node/issues/8656>. | ||
var TIMEOUT_MAX = 2147483647; // 2^31-1 | ||
if (delay > TIMEOUT_MAX) { | ||
delay = TIMEOUT_MAX; | ||
} | ||
this.timeout = setTimeout( | ||
function () { self.rotate(); }, | ||
this.rotAt - Date.now()); | ||
delay); | ||
if (typeof (this.timeout.unref) === 'function') { | ||
@@ -1180,2 +1187,8 @@ this.timeout.unref(); | ||
// If rotation period is > ~25 days, we have to break into multiple | ||
// setTimeout's. See <https://github.com/joyent/node/issues/8656>. | ||
if (self.rotAt && self.rotAt > Date.now()) { | ||
return self._setupNextRot(); | ||
} | ||
if (_DEBUG) { | ||
@@ -1182,0 +1195,0 @@ console.log('-- [%s, pid=%s] rotating %s', |
{ | ||
"name": "bunyan", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "a JSON logging library for node.js services", | ||
@@ -5,0 +5,0 @@ "author": "Trent Mick <trentm@gmail.com> (http://trentm.com)", |
@@ -42,13 +42,2 @@ Bunyan is **a simple and fast JSON logging library** for node.js services: | ||
To use the DTrace features (on platforms that support dtrace) you need | ||
to manually install the dtrace-provider library separately: | ||
npm install dtrace-provider | ||
Yes, this sucks. This used to be in "optionalDependencies" but | ||
[this](https://github.com/trentm/node-bunyan/issues/135) and other issues showed | ||
burden and confusion for users. I'm looking forward to coming *core* tracing | ||
facilities in node 0.12 to which bunyan can switch. | ||
# Features | ||
@@ -55,0 +44,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
400142
1219
1054