fixed tests broken by alwaysIncludePattern
This commit is contained in:
@@ -13,25 +13,30 @@ if (process.env.NODE_DEBUG && /\blog4js\b/.test(process.env.NODE_DEBUG)) {
|
||||
debug = function() { };
|
||||
}
|
||||
|
||||
function DateRollingFileStream(filename, pattern, alwaysIncludePattern, options, now) {
|
||||
debug("Now is " + now);
|
||||
if (pattern && typeof(pattern) === 'object') {
|
||||
now = options;
|
||||
options = pattern;
|
||||
pattern = null;
|
||||
}
|
||||
this.pattern = pattern || '.yyyy-MM-dd';
|
||||
this.now = now || Date.now;
|
||||
this.lastTimeWeWroteSomething = format.asString(this.pattern, new Date(this.now()));
|
||||
function DateRollingFileStream(filename, pattern, options, now) {
|
||||
debug("Now is " + now);
|
||||
if (pattern && typeof(pattern) === 'object') {
|
||||
now = options;
|
||||
options = pattern;
|
||||
pattern = null;
|
||||
}
|
||||
this.pattern = pattern || '.yyyy-MM-dd';
|
||||
this.now = now || Date.now;
|
||||
this.lastTimeWeWroteSomething = format.asString(this.pattern, new Date(this.now()));
|
||||
this.baseFilename = filename;
|
||||
|
||||
this.alwaysIncludePattern = alwaysIncludePattern;
|
||||
if (this.alwaysIncludePattern) {
|
||||
this.baseFilename = filename;
|
||||
filename = filename + this.lastTimeWeWroteSomething;
|
||||
if (options) {
|
||||
if (options.alwaysIncludePattern) {
|
||||
filename = filename + this.lastTimeWeWroteSomething;
|
||||
}
|
||||
debug("this.now is " + this.now + ", now is " + now);
|
||||
delete options.alwaysIncludePattern;
|
||||
if (options === {}) {
|
||||
options = null;
|
||||
}
|
||||
}
|
||||
debug("this.now is " + this.now + ", now is " + now);
|
||||
|
||||
DateRollingFileStream.super_.call(this, filename, options);
|
||||
DateRollingFileStream.super_.call(this, filename, options);
|
||||
}
|
||||
util.inherits(DateRollingFileStream, BaseRollingFileStream);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user