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

后端 未结 9 1285
情深已故
情深已故 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: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.

提交回复
热议问题