Skip to content

Commit 2135186

Browse files
committed
ability to hide deprecation warnings
1 parent f30158f commit 2135186

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

lib/client.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ Client.prototype.pauseDrain = function() {
262262
'please see the following for more details:',
263263
'https://github.com/brianc/node-postgres/wiki/pg',
264264
'https://github.com/brianc/node-postgres/issues/227',
265-
'https://github.com/brianc/node-postgres/pull/274');
265+
'https://github.com/brianc/node-postgres/pull/274',
266+
'feel free to get in touch via github if you have questions');
266267
this._drainPaused = 1;
267268
};
268269

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

lib/defaults.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,12 @@ module.exports = {
3333
//pool log function / boolean
3434
poolLog: false
3535
};
36+
37+
var deprecate = require('deprecate');
38+
//getter/setter to disable deprecation warnings
39+
module.exports.__defineGetter__("hideDeprecationWarnings", function() {
40+
return deprecate.silent;
41+
});
42+
module.exports.__defineSetter__("hideDeprecationWarnings", function(val) {
43+
deprecate.silence = val;
44+
});

lib/pool.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ var oldConnect = function(pool, client, cb) {
8585
'please see the following for more details:',
8686
'https://github.com/brianc/node-postgres/wiki/pg',
8787
'https://github.com/brianc/node-postgres/issues/227',
88-
'https://github.com/brianc/node-postgres/pull/274');
88+
'https://github.com/brianc/node-postgres/pull/274',
89+
'feel free to get in touch via github if you have questions');
8990
var tid = setTimeout(function() {
9091
console.error(errorMessage);
9192
}, alarmDuration);

lib/types/textParsers.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ var parseFloatArray = function(val) {
8383
'unexpected, hard to trace, potentially bad bugs in your program',
8484
'for more information see the following:',
8585
'https://github.com/brianc/node-postgres/pull/271',
86-
'in node-postgres v1.0.0 all floats & decimals will be returned as strings');
86+
'in node-postgres v1.0.0 all floats & decimals will be returned as strings',
87+
'feel free to get in touch via a github issue if you have any questions');
8788
if(!val) { return null; }
8889
var p = arrayParser.create(val, function(entry){
8990
if(entry !== null) {

0 commit comments

Comments
 (0)