Is there a way in JavaScript to listen console events?

前端 未结 6 2377
悲&欢浪女
悲&欢浪女 2020-12-05 04:53

I\'m trying to write handler for uncaught exceptions and browser warnings in Javascript. All errors and warnings should be sent to server for later review.

Handled e

6条回答
  •  遥遥无期
    2020-12-05 05:43

    In the same function that you are using to do console.log(), simply post the same message to a web service that you are recording the logs on.

提交回复
热议问题