Преглед изворни кода

Avoid circular dependency error when JSON.stringifying objects

Kevin van Zonneveld пре 9 година
родитељ
комит
37dfe2f217
1 измењених фајлова са 6 додато и 2 уклоњено
  1. 6 2
      src/core/Core.js

+ 6 - 2
src/core/Core.js

@@ -118,8 +118,12 @@ export default class Core {
     if (!this.opts.debug) {
       return
     }
-    msg = JSON.stringify(msg)
-    console.log(`DEBUG LOG: ${msg}`)
+    if (msg === `${msg}`) {
+      console.log(`DEBUG LOG: ${msg}`)
+    } else {
+      console.log(`DEBUG LOG`)
+      console.dir(msg)
+    }
   }
 
 /**