Is there a way to suppress warnings in the console?

I have a page that gets lots of warnings like this:

They don’t really affect the thest but with lots of VUs, the console is a mess.

Is it possible to turn off all or a subset of warnings?

Many thanks

Hi Joel, welcome to the forum!

You can supress log messages by log level using the XK6_BROWSER_LOG environment variable. Its value can be any of (from more to less verbose): trace, debug, info, warning, error, fatal and panic.

So if you wanted to suppress warnings, you could set it to any of the higher levels. E.g.:

XK6_BROWSER_LOG=error ./xk6-browser run test.js

This was more of a development feature, which is why it’s not well documented. Internally, we’ve discussed changing log levels per component and other features, so we’ll consider making this user friendlier in the future.

As an aside, that particular warning is a known issue we’ll try to get resolved soon.

1 Like

First thank you!

But maybe a flag to mute warnings by id like:

xk6-browser run test,js --no-warn:"warningname1,warningname2"

Just an idea