javascript – How to read browser logs?

Question:

I'm creating an html page that should display all browser logs ( console.log ). So when there's a script error I can go to this page and see the browser logs.

Answer:

You can override the function, but you have to overwrite it again if the page is refreshed:

<script>
/* coloque aqui a funcionalidade que deseja */
console.log = function(arg){ alert(arg); };

console.log('ola');
</script>

Abcs!

Scroll to Top