For getting information to the user, I use the python logging module. I install my own handler for nuke. After it's set, I just call myLogger.warning() (or debug, info, error, critical).
Regarding exceptions in the init and menu, it's imperative to have stable code to keep nuke launching. A try/accept statement is a good way to protect the launch process. I have some technical artists that like to contribute code. I don't give them access to the init.py so I can keep a close watch on it. Side note: A conversation about logging happened on the maya-python list just recently, and Asi Sudai was kind enough to share his log handlers for maya and nuke, details below. Cheers, Jesse On Mon, Mar 3, 2014 at 12:01 PM, Asi Sudai <snipped> wrote: > I'm a big fan of the logging module too... > On GitHub I made a custom Logging module, based on python logging, with > support for Maya, Nuke and MotionBuilder unique messages. > https://github.com/asisudai/cg-logging/blob/master/cgLogging.py > > features are: > - will use Maya or Nuke built-in warning messages > - will popup a msgbox for FATAL level, so the artists ( which rarely look > at the script editor ) could see > - will print to stdout or/and to the application script-editor. > - Email developer the traceback msg ( feature that isn't on GitHub, but > you could add easily to FATAL if you wish ) > > hope it helps anyone, feel free to contribute or branch this git. > >
_______________________________________________ Nuke-python mailing list Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python