Closed jluethi closed 3 years ago
Maybe you know,, but just in case you were wondering how to do this: you can do this using
import warnings
warnings.warn("Hello world")
:-)
Hey @haesleinhuepf Thanks for the input! I understand that this is how it's supposed to work, but haven't been able to actually get this working on my setup. Given that this seems to be the idea for how to do it, I am using the warnings system. But my warnings only show up in the napari console (if opened) or the jupyter notebook (if the console wasn't opened). Have you had that before? I haven't really traced it yet, just wanted to take a note here of the issue :)
Do the warnings show up, when the console is closed? I'm asking because I saw a bug earlier that the warnings hide behind a dock-widget on the bottom :-)
No, even when I remove the dockwidgets from the main window, the warnings only show up below the Jupyterlab cell I use to run napari. But it looks like this is some jupyterlab + napari issue. I never see any messages pop up when launching it from jupyterlab (even error messages), but I do see the error messages as napari notification if I launch napari from the command line separately. I'll report that as an issue :)
I reported it here: https://github.com/napari/napari/issues/2749
This wasn't a bug, but a design decision. Wrote a small wrapper to handle this using the notifications functionality directly:
from napari.utils.notifications import show_info
show_info("i'm a message")
See https://github.com/napari/napari/issues/2749 for details Closed with https://github.com/jluethi/napari-feature-visualization/commit/29250cf61a69e92e126160e30a5ca4e4c04a9284
Currently warnings only show up in the console. Get them into the napari notification system