replaced my debug lib with standard one
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
var fs = require('fs')
|
||||
, stream
|
||||
, debug = require('../debug')('BaseRollingFileStream')
|
||||
, debug = require('debug')('log4js:BaseRollingFileStream')
|
||||
, util = require('util')
|
||||
, semver = require('semver');
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
var BaseRollingFileStream = require('./BaseRollingFileStream')
|
||||
, debug = require('../debug')('DateRollingFileStream')
|
||||
, debug = require('debug')('log4js:DateRollingFileStream')
|
||||
, format = require('../date_format')
|
||||
, async = require('async')
|
||||
, fs = require('fs')
|
||||
@@ -9,7 +9,7 @@ var BaseRollingFileStream = require('./BaseRollingFileStream')
|
||||
module.exports = DateRollingFileStream;
|
||||
|
||||
function DateRollingFileStream(filename, pattern, options, now) {
|
||||
debug("Now is " + now);
|
||||
debug("Now is ", now);
|
||||
if (pattern && typeof(pattern) === 'object') {
|
||||
now = options;
|
||||
options = pattern;
|
||||
@@ -31,7 +31,7 @@ function DateRollingFileStream(filename, pattern, options, now) {
|
||||
options = null;
|
||||
}
|
||||
}
|
||||
debug("this.now is " + this.now + ", now is " + now);
|
||||
debug("this.now is ", this.now, ", now is ", now);
|
||||
|
||||
DateRollingFileStream.super_.call(this, filename, options);
|
||||
}
|
||||
@@ -41,8 +41,8 @@ DateRollingFileStream.prototype.shouldRoll = function() {
|
||||
var lastTime = this.lastTimeWeWroteSomething,
|
||||
thisTime = format.asString(this.pattern, new Date(this.now()));
|
||||
|
||||
debug("DateRollingFileStream.shouldRoll with now = " +
|
||||
this.now() + ", thisTime = " + thisTime + ", lastTime = " + lastTime);
|
||||
debug("DateRollingFileStream.shouldRoll with now = ",
|
||||
this.now(), ", thisTime = ", thisTime, ", lastTime = ", lastTime);
|
||||
|
||||
this.lastTimeWeWroteSomething = thisTime;
|
||||
this.previousTime = lastTime;
|
||||
@@ -81,7 +81,7 @@ DateRollingFileStream.prototype.roll = function(filename, callback) {
|
||||
}
|
||||
|
||||
function renameTheCurrentFile(cb) {
|
||||
debug("Renaming the " + filename + " -> " + newFilename);
|
||||
debug("Renaming the ", filename, " -> ", newFilename);
|
||||
fs.rename(filename, newFilename, cb);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
var BaseRollingFileStream = require('./BaseRollingFileStream')
|
||||
, debug = require('../debug')('RollingFileStream')
|
||||
, debug = require('debug')('log4js:RollingFileStream')
|
||||
, util = require('util')
|
||||
, path = require('path')
|
||||
, fs = require('fs')
|
||||
@@ -53,13 +53,13 @@ RollingFileStream.prototype.roll = function(filename, callback) {
|
||||
|
||||
function increaseFileIndex (fileToRename, cb) {
|
||||
var idx = index(fileToRename);
|
||||
debug('Index of ' + fileToRename + ' is ' + idx);
|
||||
debug('Index of ', fileToRename, ' is ', idx);
|
||||
if (idx < that.backups) {
|
||||
//on windows, you can get a EEXIST error if you rename a file to an existing file
|
||||
//so, we'll try to delete the file we're renaming to first
|
||||
fs.unlink(filename + '.' + (idx+1), function (err) {
|
||||
//ignore err: if we could not delete, it's most likely that it doesn't exist
|
||||
debug('Renaming ' + fileToRename + ' -> ' + filename + '.' + (idx+1));
|
||||
debug('Renaming ', fileToRename, ' -> ', filename, '.', (idx+1));
|
||||
fs.rename(path.join(path.dirname(filename), fileToRename), filename + '.' + (idx + 1), cb);
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user