|
@@ -750,12 +750,16 @@ var util = {
|
|
|
|
|
|
log: function () {
|
|
log: function () {
|
|
if (util.debug) {
|
|
if (util.debug) {
|
|
- var copy = [];
|
|
|
|
- for (var i = 0; i < arguments.length; i++) {
|
|
|
|
- copy[i] = arguments[i];
|
|
|
|
- }
|
|
|
|
|
|
+ var err = false;
|
|
|
|
+ var copy = Array.prototype.slice.call(arguments);
|
|
copy.unshift('PeerJS: ');
|
|
copy.unshift('PeerJS: ');
|
|
- console.log.apply(console, copy);
|
|
|
|
|
|
+ for (var i = 0, l = copy.length; i < l; i++){
|
|
|
|
+ if (copy[i] instanceof Error) {
|
|
|
|
+ copy[i] = '(' + copy[i].name + ') ' + copy[i].message;
|
|
|
|
+ err = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ err ? console.error.apply(console, copy) : console.log.apply(console, copy);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|