Comparing version 0.0.18 to 0.0.19
@@ -133,2 +133,8 @@ var logMethods = ['error', 'warn', 'info', 'log', 'trace', 'debug']; | ||
} | ||
else if (data instanceof Error) { | ||
data = '' + (data.stack || data); | ||
if (stack) { | ||
data = '[Error: ' + data + ']'; | ||
} | ||
} | ||
else if (typeof data == 'object') { | ||
@@ -135,0 +141,0 @@ stack = stack || []; |
@@ -48,5 +48,2 @@ var fs = require('fs'); | ||
logger.setFormat(function (string, type) { | ||
if (string instanceof Error) { | ||
string = string.stack || string; | ||
} | ||
var color = (type == 'warn' ? yellow : (type == 'error' ? red : bash)); | ||
@@ -135,2 +132,8 @@ string = string.replace(/^\[(\w+)\] ([^\n]+)/, function (match, name, text) { | ||
} | ||
else if (data instanceof Error) { | ||
data = '' + (data.stack || data); | ||
if (stack) { | ||
data = '[Error: ' + data + ']'; | ||
} | ||
} | ||
else if (typeof data == 'object') { | ||
@@ -137,0 +140,0 @@ stack = stack || []; |
@@ -15,3 +15,3 @@ { | ||
], | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"main": "cedar.js", | ||
@@ -18,0 +18,0 @@ "homepage": "https://github.com/lighterio/cedar", |
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
24054
612