How to save the output of a console.log(object) to a file?

后端 未结 9 1252
情深已故
情深已故 2020-11-28 00:14

I tried using JSON.stringify(object), but it doesn\'t go down on the whole structure and hierarchy.

On the other hand console.log(object) d

相关标签:
9条回答
  • 2020-11-28 00:56

    right click on console.. click save as.. its this simple.. you'll get an output text file

    0 讨论(0)
  • 2020-11-28 00:57

    There is an open-source javascript plugin that does just that - debugout.js

    Debugout.js records and save console.logs so your application can access them. Full disclosure, I wrote it. It formats different types appropriately, can handle nested objects and arrays, and can optionally put a timestamp next to each log. It also toggles live-logging in one place.

    0 讨论(0)
  • 2020-11-28 01:03

    In case you have an object logged:

    • Right click on the object in console and click Store as a global variable
    • the output will be something like temp1
    • type in console copy(temp1)
    • paste to your favorite text editor
    0 讨论(0)
提交回复
热议问题