diff --git a/lib/bunyan.js b/lib/bunyan.js index c3628f1..8ee1361 100644 --- a/lib/bunyan.js +++ b/lib/bunyan.js @@ -1051,7 +1051,12 @@ function RotatingFileStream(options) { this.stream = fs.createWriteStream(this.path, {flags: 'a', encoding: 'utf8'}); this.count = (options.count == null ? 10 : options.count); - assert.ok(typeof (this.count) === 'number' && this.count >= 0); + assert.equal(typeof (self.count), 'number', + format('rotating-file stream "count" is not a number: %j (%s) in %j', + self.count, typeof(self.count), self)); + assert.ok(self.count >= 0, + format('rotating-file stream "count" is not >= 0: %j in %j', + self.count, self)); // Parse `options.period`. if (options.period) {