diff options
author | Michael Lumish <mlumish@google.com> | 2017-08-01 10:47:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-01 10:47:40 -0700 |
commit | d885d24161e9ebf7c1f1d225569c949cd909fd06 (patch) | |
tree | 51b57844d5277cd0ad81bfd6de92c6b356463232 /src | |
parent | eb9c99b9fb23c62cb3195d5ec958aa8afd45083d (diff) | |
parent | 6fe29a5e811799095465d006afa065767b5d863c (diff) |
Merge pull request #12004 from murgatroid99/node_deprecation_message_util
Node: replace custom deprecation warning with existing solution
Diffstat (limited to 'src')
-rw-r--r-- | src/node/src/server.js | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/node/src/server.js b/src/node/src/server.js index fba0aac938..8b7c0b6862 100644 --- a/src/node/src/server.js +++ b/src/node/src/server.js @@ -919,11 +919,6 @@ Server.prototype.addService = function(service, implementation) { }); }; -var logAddProtoServiceDeprecationOnce = _.once(function() { - common.log(constants.logVerbosity.INFO, - 'Server#addProtoService is deprecated. Use addService instead'); -}); - /** * Add a proto service to the server, with a corresponding implementation * @deprecated Use {@link grpc.Server#addService} instead @@ -931,11 +926,11 @@ var logAddProtoServiceDeprecationOnce = _.once(function() { * @param {Object<String, grpc.Server~handleCall>} implementation Map of method * names to method implementation for the provided service. */ -Server.prototype.addProtoService = function(service, implementation) { +Server.prototype.addProtoService = util.deprecate(function(service, + implementation) { var options; var protobuf_js_5_common = require('./protobuf_js_5_common'); var protobuf_js_6_common = require('./protobuf_js_6_common'); - logAddProtoServiceDeprecationOnce(); if (protobuf_js_5_common.isProbablyProtobufJs5(service)) { options = _.defaults(service.grpc_options, common.defaultGrpcOptions); this.addService( @@ -950,7 +945,7 @@ Server.prototype.addProtoService = function(service, implementation) { // We assume that this is a service attributes object this.addService(service, implementation); } -}; +}, 'Server#addProtoService: Use Server#addService instead'); /** * Binds the server to the given port, with SSL disabled if creds is an |