Sending error messages from python


As I can see there are at least two ways of sending errors from scripted modules:

  • logging.error()
  • qt.qCritical()

Which is the preferred one?

Also does Slicer write logs somewhere in the text file? For example if my app crash I would like to see the logs.

From python, you should use the logging module.

Consider reading these sections:


Just to clarify, does Slicer somehow write logs to file?

It does, see Log outputs link referenced in the User Guide

1 Like

Thank you very much!

1 Like