How to silence Bokeh warnings

I’m attempting to suppress warnings from printing in the terminal. One example of a warning I’m trying to silence:

WARNING:bokeh.io:The webdriver raised a TimeoutException while waiting for a ‘bokeh:idle’ event to signify that the layout has rendered. Something may have gone wrong.

I apologize if this is documented somewhere, but I’m struggling to find it. Thanks for any pointers!

Hi,

You can set the Bokeh log level with an env var:

  https://bokeh.pydata.org/en/latest/docs/dev_guide/env_vars.html#bokeh-log-level

Thanks,

Bryan

···

On Sep 28, 2017, at 16:47, [email protected] wrote:

I'm attempting to suppress warnings from printing in the terminal. One example of a warning I'm trying to silence:

WARNING:bokeh.io:The webdriver raised a TimeoutException while waiting for a 'bokeh:idle' event to signify that the layout has rendered. Something may have gone wrong.

I apologize if this is documented somewhere, but I'm struggling to find it. Thanks for any pointers!

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/b0c2a4b3-6580-47d1-8176-13b02d2c1c78%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hi, has anyone been able to successfully silence BokehUserWarning warnings? I’ve tried to silence them with warnings.simplefilter as well as setting the BOKEH_LOG_LEVEL to ‘fatal’. I

I’m running an embedded bokeh server.

Thank you.

Maybe there is something different happening in the embedded case? I don’t know offhand Your best bet to get assistance is to provide a complete Minimal Reproducible Example and instructions to reproduce, to avoid wasting effort with speculation.

What is the standard way to silence BokehUserWarnings and suppress them from being printed to the console? It’s difficult for me to provide a minimal reproducible example in this case as it is more of a general question.

I would expect either of the things you mentioned above to work, which is why I asked for an MRE.

Understood. I was working on a MRE; however I’ve fixed it in the process. I first call this code to start my server:

server = Server({'/TestServer': TestApp.main.main}, extra_patterns=extra_patterns, websocket_max_message_size=270000000) server.start()

Then I import and silence warnings:

from bokeh.util.warnings import BokehUserWarning import warnings warnings.simplefilter(action='ignore', category=BokehUserWarning)

Appears to be working now. Previously, I was trying to ignore the errors before the code to start the server.

Thank you.

Actually, I forgot, BOKEH_LOG_LEVEL is purely for the log level in the browser (original historical name, too late to change now). For the python logging it is more specifically:

BOKEH_PY_LOG_LEVEL=critical

I am actually not any sort of expert about the python logging system API and filtering, so glad you found the programmatic solution.

Yes, I had also looked at the BOKEH_PY_LOG_LEVEL environment variable. I believe I read it was set to ‘none’ on default. Regardless, at least the solution I posted seems to work for embedded servers.

Thank you.