changelog for recent stuff; 'DEBUG' was a dumb name for this internal var
This commit is contained in:
parent
473736b9e0
commit
573c33ab99
2 changed files with 13 additions and 11 deletions
|
@ -8,7 +8,9 @@ Known issues:
|
|||
|
||||
## bunyan 0.18.2 (not yet released)
|
||||
|
||||
(nothing yet)
|
||||
- [pull #67] Remove debugging prints in rotating-file support.
|
||||
(by github.com/chad3814).
|
||||
- Update to dtrace-provider@0.2.7.
|
||||
|
||||
|
||||
## bunyan 0.18.1
|
||||
|
|
|
@ -992,12 +992,12 @@ RotatingFileStream.prototype._setupNextRot = function () {
|
|||
}
|
||||
|
||||
RotatingFileStream.prototype._nextRotTime = function _nextRotTime(first) {
|
||||
var DEBUG = false;
|
||||
if (DEBUG) console.log('-- _nextRotTime: %s%s', this.periodNum, this.periodScope);
|
||||
var _DEBUG = false;
|
||||
if (_DEBUG) console.log('-- _nextRotTime: %s%s', this.periodNum, this.periodScope);
|
||||
var d = new Date();
|
||||
|
||||
if (DEBUG) console.log(' now local: %s', d);
|
||||
if (DEBUG) console.log(' now utc: %s', d.toISOString());
|
||||
if (_DEBUG) console.log(' now local: %s', d);
|
||||
if (_DEBUG) console.log(' now utc: %s', d.toISOString());
|
||||
var rotAt;
|
||||
switch (this.periodScope) {
|
||||
case 'ms':
|
||||
|
@ -1055,7 +1055,7 @@ RotatingFileStream.prototype._nextRotTime = function _nextRotTime(first) {
|
|||
assert.fail(format('invalid period scope: "%s"', this.periodScope));
|
||||
}
|
||||
|
||||
if (DEBUG) {
|
||||
if (_DEBUG) {
|
||||
console.log(' **rotAt**: %s (utc: %s)', rotAt,
|
||||
new Date(rotAt).toUTCString());
|
||||
var now = Date.now();
|
||||
|
@ -1071,9 +1071,9 @@ RotatingFileStream.prototype._nextRotTime = function _nextRotTime(first) {
|
|||
RotatingFileStream.prototype.rotate = function rotate() {
|
||||
// XXX What about shutdown?
|
||||
var self = this;
|
||||
var DEBUG = false;
|
||||
var _DEBUG = false;
|
||||
|
||||
if (DEBUG) console.log('-- [%s] rotating %s', new Date(), self.path);
|
||||
if (_DEBUG) console.log('-- [%s] rotating %s', new Date(), self.path);
|
||||
if (self.rotating) {
|
||||
throw new TypeError('cannot start a rotation when already rotating');
|
||||
}
|
||||
|
@ -1087,7 +1087,7 @@ RotatingFileStream.prototype.rotate = function rotate() {
|
|||
toDel = self.path;
|
||||
}
|
||||
n -= 1;
|
||||
if (DEBUG) console.log('rm %s', toDel);
|
||||
if (_DEBUG) console.log('rm %s', toDel);
|
||||
fs.unlink(toDel, function (delErr) {
|
||||
//XXX handle err other than not exists
|
||||
moves();
|
||||
|
@ -1108,7 +1108,7 @@ RotatingFileStream.prototype.rotate = function rotate() {
|
|||
if (!exists) {
|
||||
moves();
|
||||
} else {
|
||||
if (DEBUG) console.log('mv %s %s', before, after);
|
||||
if (_DEBUG) console.log('mv %s %s', before, after);
|
||||
mv(before, after, function (mvErr) {
|
||||
if (mvErr) {
|
||||
self.emit('error', mvErr);
|
||||
|
@ -1122,7 +1122,7 @@ RotatingFileStream.prototype.rotate = function rotate() {
|
|||
}
|
||||
|
||||
function finish() {
|
||||
if (DEBUG) console.log('open %s', self.path);
|
||||
if (_DEBUG) console.log('open %s', self.path);
|
||||
self.stream = fs.createWriteStream(self.path,
|
||||
{flags: 'a', encoding: 'utf8'});
|
||||
var q = self.rotQueue, len = q.length;
|
||||
|
|
Loading…
Reference in a new issue