NODE_DEBUG uses strings instead of bitflags

This commit is contained in:
Ryan Dahl 2011-01-03 15:27:57 -08:00
parent d040f1d19d
commit e4dd5cd6fd
4 changed files with 4 additions and 8 deletions

View File

@ -6,8 +6,7 @@ var HTTPParser = process.binding('http_parser').HTTPParser;
var debug;
var debugLevel = parseInt(process.env.NODE_DEBUG, 16);
if (debugLevel & 0x4) {
if (process.env.NODE_DEBUG && /http/.test(process.env.NODE_DEBUG)) {
debug = function(x) { console.error('HTTP: %s', x); };
} else {
debug = function() { };

View File

@ -5,9 +5,8 @@ var stream = require('stream');
var kMinPoolSpace = 128;
var kPoolSize = 40 * 1024;
var debugLevel = parseInt(process.env.NODE_DEBUG, 16);
var debug;
if (debugLevel & 0x2) {
if (process.env.NODE_DEBUG && /net/.test(process.env.NODE_DEBUG)) {
debug = function(x) { util.error.apply(this, arguments); };
} else {
debug = function() { };

View File

@ -6,9 +6,8 @@ var stream = require('stream');
var assert = process.assert;
var debugLevel = parseInt(process.env.NODE_DEBUG, 16);
var debug;
if (debugLevel & 0x2) {
if (process.env.NODE_DEBUG && /tls/.test(process.env.NODE_DEBUG)) {
debug = function() { util.error.apply(this, arguments); };
} else {
debug = function() { };

View File

@ -123,9 +123,8 @@
// Modules
var debugLevel = parseInt(process.env['NODE_DEBUG'], 16);
var debug;
if (debugLevel & 1) {
if (process.env.NODE_DEBUG && /module/.test(process.env.NODE_DEBUG)) {
debug = function(x) { console.error(x); };
} else {
debug = function() { };