Permalink
Browse files

call _logger on this, not on prototype

  • Loading branch information...
1 parent 7858da3 commit 9af4a5b574f67375846147415fd97ca08b3d0091 @coolaj86 committed Oct 11, 2012
Showing with 8 additions and 8 deletions.
  1. +3 −3 http-json/README.md
  2. +4 −4 http-json/index.js
  3. +1 −1 http-json/package.json
View
6 http-json/README.md
@@ -38,7 +38,7 @@ Response
{
"success": true
, "errors": []
- , "warns": [{"message":"Did you know that 1 out of 3 times is error time?"}]
+ , "warnings": [{"message":"Did you know that 1 out of 3 times is error time?"}]
, "foo-secret": 42
, "timestamp": 1339631260781
, "result": "What time is it? Success time!"
@@ -72,11 +72,11 @@ Add a field to the "header" (sibling of `result`, `errors`, etc)
http.ServerResponse.prototype.warn(Error)
---
-Add an Error to the `warns` array, but `success` is left as true.
+Add an Error to the `warnings` array, but `success` is left as true.
`Error` may also be `null`/`undefined` (ignored), an array of Errors, or an empty array (ignored).
-**Note**: By default, stack traces will be removed from warns.
+**Note**: By default, stack traces will be removed from warnings.
http.ServerResponse.prototype.error(Error)
---
View
8 http-json/index.js
@@ -46,20 +46,20 @@
};
resProto.warn = function (msg, code, opts) {
- resProto._logger('warn', msg, code, opts);
+ this._logger('warn', msg, code, opts);
};
resProto.error = function (msg, code, opts) {
- resProto._logger('error', msg, code, opts);
+ this._logger('error', msg, code, opts);
};
/*
resProto.info = function (msg, code, opts) {
- resProto._logger('info', msg, code, opts);
+ this._logger('info', msg, code, opts);
};
resProto.debug = function (msg, code, opts) {
- resProto._logger('info', msg, code, opts);
+ this._logger('info', msg, code, opts);
};
*/
View
2 http-json/package.json
@@ -2,7 +2,7 @@
"author": "AJ ONeal <coolaj86@gmail.com> (http://coolaj86.info/)",
"name": "http-json",
"description": "An extension of the http prototype supporting steve-style json responses in connect",
- "version": "1.2.0",
+ "version": "1.2.1",
"homepage": "http://github.com/coolaj86/steve",
"repository": {
"type": "git",

0 comments on commit 9af4a5b

Please sign in to comment.