diff --git a/lib/hooks/responses/index.js b/lib/hooks/responses/index.js index 8d52e95bdc..b4d48bb20a 100644 --- a/lib/hooks/responses/index.js +++ b/lib/hooks/responses/index.js @@ -199,6 +199,18 @@ function _mixin_jsonx(req, res) { */ res.jsonx = res.jsonx || function jsonx (data){ + var caller = jsonx.caller && jsonx.caller.name; + + // Log a deprecation notice. + sails.log.debug('***********************************************************************************'); + sails.log.debug('`res.jsonx()` is deprecated in Sails v1.0 and will be removed in a future release.'); + sails.log.debug('Any files in api/responses that haven\'t been customized can simply be removed.'); + sails.log.debug('Otherwise see http://sailsjs.com/upgrading for options to replace `res.jsonx()`.'); + if (caller) { + sails.log.debug('(jsonx was called from `' + caller + '`)'); + } + sails.log.debug('***********************************************************************************'); + // Send conventional status message if no data was provided // (see http://expressjs.com/api.html#res.send) if (_.isUndefined(data)) {