backporting new streams to node 0.8 for issue #129
This commit is contained in:
parent
36c5175a55
commit
ed7462885f
@ -1,6 +1,13 @@
|
||||
var fs = require('fs'),
|
||||
stream = require('stream'),
|
||||
util = require('util');
|
||||
stream,
|
||||
util = require('util'),
|
||||
semver = require('semver');
|
||||
|
||||
if (semver.satisfies(process.version, '>=0.10.0')) {
|
||||
stream = require('stream');
|
||||
} else {
|
||||
stream = require('readable-stream');
|
||||
}
|
||||
|
||||
var debug;
|
||||
if (process.env.NODE_DEBUG && /\blog4js\b/.test(process.env.NODE_DEBUG)) {
|
||||
@ -69,7 +76,7 @@ BaseRollingFileStream.prototype.openTheStream = function(cb) {
|
||||
|
||||
BaseRollingFileStream.prototype.closeTheStream = function(cb) {
|
||||
debug("closing the underlying stream");
|
||||
this.theStream.end(null, null, cb);
|
||||
this.theStream.end(cb);
|
||||
};
|
||||
|
||||
BaseRollingFileStream.prototype.shouldRoll = function() {
|
||||
|
@ -29,7 +29,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"async": "0.1.15",
|
||||
"dequeue": "1.0.3"
|
||||
"dequeue": "1.0.3",
|
||||
"semver": "~1.1.4",
|
||||
"readable-stream": "~1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vows": "0.7.0",
|
||||
|
@ -1,10 +1,18 @@
|
||||
var vows = require('vows')
|
||||
, assert = require('assert')
|
||||
, streams = require('stream')
|
||||
, fs = require('fs')
|
||||
, DateRollingFileStream = require('../../lib/streams').DateRollingFileStream
|
||||
, semver = require('semver')
|
||||
, streams
|
||||
, DateRollingFileStream
|
||||
, testTime = new Date(2012, 8, 12, 10, 37, 11);
|
||||
|
||||
if (semver.satisfies(process.version, '>=0.10.0')) {
|
||||
streams = require('stream');
|
||||
} else {
|
||||
streams = require('readable-stream');
|
||||
}
|
||||
DateRollingFileStream = require('../../lib/streams').DateRollingFileStream
|
||||
|
||||
function cleanUp(filename) {
|
||||
return function() {
|
||||
fs.unlink(filename);
|
||||
|
@ -3,8 +3,16 @@ var vows = require('vows')
|
||||
, assert = require('assert')
|
||||
, events = require('events')
|
||||
, fs = require('fs')
|
||||
, streams = require('stream')
|
||||
, RollingFileStream = require('../../lib/streams').RollingFileStream;
|
||||
, semver = require('semver')
|
||||
, streams
|
||||
, RollingFileStream;
|
||||
|
||||
if (semver.satisfies(process.version, '>=0.10.0')) {
|
||||
streams = require('stream');
|
||||
} else {
|
||||
streams = require('readable-stream');
|
||||
}
|
||||
RollingFileStream = require('../../lib/streams').RollingFileStream;
|
||||
|
||||
function remove(filename) {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user