ability to hide deprecation warnings

This commit is contained in:
brianc 2013-03-07 10:01:14 -06:00
parent f30158f7c4
commit 213518648b
4 changed files with 17 additions and 4 deletions

View File

@ -262,7 +262,8 @@ Client.prototype.pauseDrain = function() {
'please see the following for more details:', 'please see the following for more details:',
'https://github.com/brianc/node-postgres/wiki/pg', 'https://github.com/brianc/node-postgres/wiki/pg',
'https://github.com/brianc/node-postgres/issues/227', 'https://github.com/brianc/node-postgres/issues/227',
'https://github.com/brianc/node-postgres/pull/274'); 'https://github.com/brianc/node-postgres/pull/274',
'feel free to get in touch via github if you have questions');
this._drainPaused = 1; this._drainPaused = 1;
}; };
@ -272,7 +273,8 @@ Client.prototype.resumeDrain = function() {
'please see the following for more details:', 'please see the following for more details:',
'https://github.com/brianc/node-postgres/wiki/pg', 'https://github.com/brianc/node-postgres/wiki/pg',
'https://github.com/brianc/node-postgres/issues/227', 'https://github.com/brianc/node-postgres/issues/227',
'https://github.com/brianc/node-postgres/pull/274'); 'https://github.com/brianc/node-postgres/pull/274',
'feel free to get in touch via github if you have questions');
if(this._drainPaused > 1) { if(this._drainPaused > 1) {
this.emit('drain'); this.emit('drain');
} }

View File

@ -33,3 +33,12 @@ module.exports = {
//pool log function / boolean //pool log function / boolean
poolLog: false poolLog: false
}; };
var deprecate = require('deprecate');
//getter/setter to disable deprecation warnings
module.exports.__defineGetter__("hideDeprecationWarnings", function() {
return deprecate.silent;
});
module.exports.__defineSetter__("hideDeprecationWarnings", function(val) {
deprecate.silence = val;
});

View File

@ -85,7 +85,8 @@ var oldConnect = function(pool, client, cb) {
'please see the following for more details:', 'please see the following for more details:',
'https://github.com/brianc/node-postgres/wiki/pg', 'https://github.com/brianc/node-postgres/wiki/pg',
'https://github.com/brianc/node-postgres/issues/227', 'https://github.com/brianc/node-postgres/issues/227',
'https://github.com/brianc/node-postgres/pull/274'); 'https://github.com/brianc/node-postgres/pull/274',
'feel free to get in touch via github if you have questions');
var tid = setTimeout(function() { var tid = setTimeout(function() {
console.error(errorMessage); console.error(errorMessage);
}, alarmDuration); }, alarmDuration);

View File

@ -83,7 +83,8 @@ var parseFloatArray = function(val) {
'unexpected, hard to trace, potentially bad bugs in your program', 'unexpected, hard to trace, potentially bad bugs in your program',
'for more information see the following:', 'for more information see the following:',
'https://github.com/brianc/node-postgres/pull/271', 'https://github.com/brianc/node-postgres/pull/271',
'in node-postgres v1.0.0 all floats & decimals will be returned as strings'); 'in node-postgres v1.0.0 all floats & decimals will be returned as strings',
'feel free to get in touch via a github issue if you have any questions');
if(!val) { return null; } if(!val) { return null; }
var p = arrayParser.create(val, function(entry){ var p = arrayParser.create(val, function(entry){
if(entry !== null) { if(entry !== null) {