How to hide source of Log messages in Console?

前端 未结 2 1502
滥情空心
滥情空心 2021-01-31 16:27

When outputting messages into the console, the source is also displayed (in Chrome Developer Tools it\'s on the right):

console.log(\"Foo\");                             


        
2条回答
  •  旧时难觅i
    2021-01-31 17:17

    They are using setTimeout to detach from the source:

    setTimeout(console.log.bind(console, '\n%c' + s[0], s[1]));
    

提交回复
热议问题