Permalink
Browse files

Merge pull request #109 from mobify/error-logging

Call toString on Error objects when logging to console.
  • Loading branch information...
2 parents 57c75ef + 53d7664 commit b9955605e27959b32311a07666cf34a1bcedc6e2 @johnboxall johnboxall committed Mar 6, 2013
Showing with 3 additions and 0 deletions.
  1. +3 −0 api/logging.js
View
@@ -23,8 +23,11 @@
if (obj) {
$.each(obj, function(key, value) {
noneWritten && console.group(title);
+
if (typeof key == "number") {
console[fn].apply(window, value);
+ } else if (value instanceof Error) {
+ console.error(key, value.toString());
} else {
console[fn](key, value);
}

0 comments on commit b995560

Please sign in to comment.