Closed vikramsubramanian closed 2 months ago
Hi
Your issue seems related to right?
Unfortunately, according to the research I did at that time, it did not seem possible to fix the problem on the Loguru side. It happens due to Qt introspecting the modified signature of the decorated function.
Workaround suggested are either:
PySide.QtCore.pyqtSlot()
instead of Slot
sys.excepthook
Apologies, I wrote out a response to you but never hit "Comment" haha. My bad.
Yes, it appears hashtag440 is related. It's unfortunate that Qt does such invasive introspection--I would have thought having ` on top would work, but that appears not to be the case.
Also, PySide6 does not have pyqtSlot
, only Slot
. sys.excepthook
also does not work as I already have one set up--perhaps, because the errors occur in a separate QThread
than the main GUI, Qt is silencing them before the caller receives them? That'd be the only thing I can think of.
For now, using with logger.catch
is working, so I'll just continue to use that.
Anyways, thanks for the help.
I am currently developing an application to control some hardware devices. Occasionally, some unexpected behavior will cause errors in my application that I would like to log to fix as they occur.
Unfortunately, it does not appear that
works on decorated
methods. It also does not appear that changing the order of the decorations makes a difference in terms of my issue or the behavior of PySide6.When these errors occur, I receive no indication that an error even occurred as PySide suppresses it.
Here is an MRE:
As a workaround, using
logger.catch
as a context manager does work as intended, so I can use that method while we work through this issue.Thanks, Jules