Comparing version 0.14.2 to 0.14.4
# bunyan Changelog | ||
## bunyan 0.14.4 | ||
- Improve error serialization to walk the chain of `.cause()` errors | ||
from the likes of `WError` or `VError` error classes from | ||
[verror](https://github.com/davepacheco/node-verror) and | ||
[restify v2.0](https://github.com/mcavage/node-restify). Example: | ||
[2012-10-11T00:30:21.871Z] ERROR: imgapi/99612 on 0525989e-2086-4270-b960-41dd661ebd7d: my-message | ||
ValidationFailedError: my-message; caused by TypeError: cause-error-message | ||
at Server.apiPing (/opt/smartdc/imgapi/lib/app.js:45:23) | ||
at next (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:550:50) | ||
at Server.setupReq (/opt/smartdc/imgapi/lib/app.js:178:9) | ||
at next (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:550:50) | ||
at Server.parseBody (/opt/smartdc/imgapi/node_modules/restify/lib/plugins/body_parser.js:15:33) | ||
at next (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:550:50) | ||
at Server.parseQueryString (/opt/smartdc/imgapi/node_modules/restify/lib/plugins/query.js:40:25) | ||
at next (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:550:50) | ||
at Server._run (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:579:17) | ||
at Server._handle.log.trace.req (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:480:38) | ||
Caused by: TypeError: cause-error-message | ||
at Server.apiPing (/opt/smartdc/imgapi/lib/app.js:40:25) | ||
at next (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:550:50) | ||
at Server.setupReq (/opt/smartdc/imgapi/lib/app.js:178:9) | ||
at next (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:550:50) | ||
at Server.parseBody (/opt/smartdc/imgapi/node_modules/restify/lib/plugins/body_parser.js:15:33) | ||
at next (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:550:50) | ||
at Server.parseQueryString (/opt/smartdc/imgapi/node_modules/restify/lib/plugins/query.js:40:25) | ||
at next (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:550:50) | ||
at Server._run (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:579:17) | ||
at Server._handle.log.trace.req (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:480:38) | ||
## bunyan 0.14.2 | ||
@@ -37,3 +69,3 @@ | ||
to its log level number value: | ||
> bunyan.resolveLevel('INFO') | ||
@@ -43,3 +75,3 @@ 30 | ||
20 | ||
A side-effect of this change is that the uppercase level name is now allowed | ||
@@ -46,0 +78,0 @@ in the logger constructor. |
@@ -7,3 +7,3 @@ /* | ||
var VERSION = '0.14.2'; | ||
var VERSION = '0.14.4'; | ||
@@ -991,2 +991,20 @@ // Bunyan log format version. This becomes the 'v' field on all log records. | ||
/* | ||
* This function dumps long stack traces for exceptions having a cause() | ||
* method. The error classes from | ||
* [verror](https://github.com/davepacheco/node-verror) and | ||
* [restify v2.0](https://github.com/mcavage/node-restify) are examples. | ||
* | ||
* Based on `dumpException` in | ||
* https://github.com/davepacheco/node-extsprintf/blob/master/lib/extsprintf.js | ||
*/ | ||
function getFullErrorStack(ex) | ||
{ | ||
var ret = ex.stack || ex.toString(); | ||
if (ex.cause && typeof(ex.cause) === 'function') | ||
ret += '\nCaused by: ' + getFullErrorStack(ex.cause()); | ||
return (ret); | ||
} | ||
// Serialize an Error object | ||
@@ -1000,3 +1018,3 @@ // (Core error properties are enumerable in node 0.4, not in 0.6). | ||
name: err.name, | ||
stack: err.stack | ||
stack: getFullErrorStack(err) | ||
} | ||
@@ -1011,2 +1029,3 @@ Object.keys(err).forEach(function (k) { | ||
// A JSON stringifier that handles cycles safely. | ||
@@ -1013,0 +1032,0 @@ // Usage: JSON.stringify(obj, safeCycles()) |
{ | ||
"name": "bunyan", | ||
"version": "0.14.2", | ||
"version": "0.14.4", | ||
"description": "a JSON Logger library for node.js services", | ||
@@ -5,0 +5,0 @@ "author": "Trent Mick <trentm@gmail.com> (http://trentm.com)", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
233997
2367