Merge pull request #125 from jimschubert/master

Allow for somewhat standard debugging calls
This commit is contained in:
Gareth Jones 2013-03-24 19:35:24 -07:00
commit 83271e47fc
3 changed files with 15 additions and 7 deletions

View File

@ -2,8 +2,11 @@ var fs = require('fs'),
stream = require('stream'),
util = require('util');
function debug(message) {
// console.log(message);
var debug;
if (process.env.NODE_DEBUG && /\blog4js\b/.test(process.env.NODE_DEBUG)) {
debug = function(message) { console.error('LOG4JS: (BaseRollingFileStream) %s', message); };
} else {
debug = function() { };
}
module.exports = BaseRollingFileStream;

View File

@ -6,8 +6,11 @@ var BaseRollingFileStream = require('./BaseRollingFileStream'),
module.exports = DateRollingFileStream;
function debug(message) {
// console.log(message);
var debug;
if (process.env.NODE_DEBUG && /\blog4js\b/.test(process.env.NODE_DEBUG)) {
debug = function(message) { console.error('LOG4JS: (DateRollingFileStream) %s', message); };
} else {
debug = function() { };
}
function DateRollingFileStream(filename, pattern, options, now) {

View File

@ -4,9 +4,11 @@ var BaseRollingFileStream = require('./BaseRollingFileStream'),
fs = require('fs'),
async = require('async');
function debug() {
// util.debug(message);
// console.log.apply(console, arguments);
var debug;
if (process.env.NODE_DEBUG && /\blog4js\b/.test(process.env.NODE_DEBUG)) {
debug = function(message) { console.error('LOG4JS: (RollingFileStream) %s', message); };
} else {
debug = function() { };
}
module.exports = RollingFileStream;