Browse Source

better logging

Michelle Bu 12 năm trước cách đây
mục cha
commit
5bfc0cb78d
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      lib/util.js

+ 5 - 1
lib/util.js

@@ -1,6 +1,7 @@
 var util = {
   
   debug: false,
+  browserisms: '',
   
   inherits: function(ctor, superCtor) {
     ctor.super_ = superCtor;
@@ -29,9 +30,12 @@ var util = {
   
   log: function () {
     if (util.debug) {
+      var copy = [];
       for (var i = 0; i < arguments.length; i++) {
-        console.log('*', i, '-- ', arguments[i]);
+        copy[i] = arguments[i];
       }
+      copy.unshift('PeerJS: ');
+      console.log.apply(console, copy);
     }
   },