mirror of https://github.com/nodejs/node.git
util: always display a warning for module in debug mode
parent
23de33968f
commit
df62005ece
15
lib/util.js
15
lib/util.js
|
@ -522,15 +522,16 @@ exports.inherits = function(ctor, superCtor) {
|
||||||
var deprecationWarnings;
|
var deprecationWarnings;
|
||||||
|
|
||||||
exports._deprecationWarning = function(moduleId, message) {
|
exports._deprecationWarning = function(moduleId, message) {
|
||||||
if (!deprecationWarnings)
|
if ((new RegExp('\\b' + moduleId + '\\b')).test(process.env.NODE_DEBUG)) {
|
||||||
|
console.trace(message);
|
||||||
|
} else {
|
||||||
|
if (!deprecationWarnings) {
|
||||||
deprecationWarnings = {};
|
deprecationWarnings = {};
|
||||||
else if (message in deprecationWarnings)
|
} else if (message in deprecationWarnings) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
console.error(message);
|
||||||
|
|
||||||
deprecationWarnings[message] = true;
|
deprecationWarnings[message] = true;
|
||||||
|
}
|
||||||
if ((new RegExp('\\b' + moduleId + '\\b')).test(process.env.NODE_DEBUG))
|
|
||||||
console.trace(message);
|
|
||||||
else
|
|
||||||
console.error(message);
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue