From e4dd5cd6fd7b44f4fc21a5cfd39615a7a5833957 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 3 Jan 2011 15:27:57 -0800 Subject: [PATCH] NODE_DEBUG uses strings instead of bitflags --- lib/http.js | 3 +-- lib/net.js | 3 +-- lib/tls.js | 3 +-- src/node.js | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/http.js b/lib/http.js index 0b4a0e2212f..5594a8ff1c4 100644 --- a/lib/http.js +++ b/lib/http.js @@ -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() { }; diff --git a/lib/net.js b/lib/net.js index d29984668a3..f240f8a3516 100644 --- a/lib/net.js +++ b/lib/net.js @@ -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() { }; diff --git a/lib/tls.js b/lib/tls.js index 433d33958c4..bcb036edc84 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -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() { }; diff --git a/src/node.js b/src/node.js index ca4bead83e4..1d1ca687d86 100644 --- a/src/node.js +++ b/src/node.js @@ -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() { };