Explorar el Código

Avoid circular dependency error when JSON.stringifying objects

Kevin van Zonneveld hace 9 años
padre
commit
37dfe2f217
Se han modificado 1 ficheros con 6 adiciones y 2 borrados
  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)
+    }
   }
 
 /**