Delete all console logs

5

There is some way to delete all the logs from the console and start over, like I inserted several logs there using console.log, however I want to remove them all at once and start over again by inserting others.

li on console.clear () only nothing happens ..

    
asked by anonymous 19.03.2015 / 19:37

2 answers

6

The command to clear the console is console.clear() .

If you are not cleaning the console, you should have Preserve log enabled. This option is to prevent other scripts from cleaning the console, making it difficult to debug the code.

    
19.03.2015 / 20:47
0

Supports Chrome & IE, did not test Opera and Firefox for testing is thank you.

While the error is just look at the tutorial link

even more

(function(){
  var msdn = console;
  Object.defineProperty( eval, "console", {
  get : function(){
      if( msdn._commandLineAPI ){
      throw "Navegador não suporta o objeto defineProperty!";
          }
      return msdn; 
  },
  set : function(val){
      msdn = val;
  }
  });
})();
<script>
// TESTE de enviar console.log
console.log("OI BRASIL");
console.log("TESTADO");
console.log = function() {};
console.log("BORA OLIMPIADAS");
</script>
    
24.06.2016 / 17:00