Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.

Call toString on Error objects when logging to console. #109

Merged
merged 1 commit into from
Mar 6, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down