thanks Nathan. will have a peek at that

On 23/06/14 17:14, Nathan Rusch wrote:
Nuke replaces `sys.stdout` with its own stream object that writes to the script editor. Thus, by the time your logging code comes along and creates its output handler(s), it's binding to the replacement instead. Python always stores the original stream at sys.__stdout__ though, so you can either bind your stream handler to that (which will be enough to write to the terminal), or write your own basic handler subclass to do whatever you want (e.g. write to both).
-Nathan

*From:* Frank Rueter|OHUfx <mailto:fr...@ohufx.com>
*Sent:* Sunday, June 22, 2014 4:22 PM
*To:* Nuke Python discussion <mailto:nuke-python@support.thefoundry.co.uk>
*Subject:* [Nuke-python] log levels in nuke
Hi all,

I re-jigged some of my existing code to use the logging module by putting something like this into the heads of my modules:
import logging
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG, format='||%(name)s | %(module)s | %(funcName)s | %(levelname)s || %(message)s')


However, when run in Nuke, nothing is printed to the terminal, even when I try to set the log level to debug in the menu.py as well.
What am I missing?

Cheers,
frank

--
ohufxLogo 50x50 <http://www.ohufx.com> *vfx compositing <http://ohufx.com/index.php/vfx-compositing> | *workflow customisation and consulting <http://ohufx.com/index.php/vfx-customising>* *

------------------------------------------------------------------------
_______________________________________________
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


_______________________________________________
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

--
ohufxLogo 50x50 <http://www.ohufx.com> *vfx compositing <http://ohufx.com/index.php/vfx-compositing> | *workflow customisation and consulting <http://ohufx.com/index.php/vfx-customising>* *

_______________________________________________
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

Reply via email to