question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stop Chrome console logs?

See original GitHub issue

Is there a way to prevent the logs from the browser console to show up in the test output? I looked at the Chromium command line flags but I didn’t find the one.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
WalkingDextercommented, Sep 23, 2022

Works with Playwright engine (in onBefore.js) page.removeAllListeners('console');

1reaction
randombitsUKcommented, Oct 10, 2019

Thanks to some of the suggestions here, I’ve implemented it in this way (in onBefore.js)

module.exports = async (page, scenario, vp) => {
    const ignoredMessages = [
        'Download the React DevTools for a better development experience',
        'BackstopTools have been installed',
    ];

    console.log = (message) => {
        ignoredMessages.some(ignore => message.includes(ignore)) ? undefined : process.stdout.write(`${message}\n`);
    };

    ...
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

Stop Console.Logging! This is How to Use Chrome to Debug ...
Instead of console.logging and restarting every time you want to debug, you can instead use Chrome DevTools (right click + inspect).
Read more >
how to turn off console.log message grouping? - Stack Overflow
In the top-right corner of the console window, there is a cogwheel button that opens a panel with a ...
Read more >
How to stop using console.log() and start using your browser's ...
In order to debug this in Chrome, you need to get used to using DevTools. To open Chrome Developer Tools, press Command+Option+I (Mac)...
Read more >
Stop Console.Logging! This is How to Use ... - FAUN Publication
Instead of console.logging and restarting every time you want to debug, you can instead use Chrome DevTools (right click + inspect).
Read more >
Stop Using console.log()! - Daily.dev
Debugging Tip: Asynchronous stack trace (now the default in Chrome) allows you to inspect function calls beyond the current event loop, just ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found