Since you're running it in a menu.py, my guess is that your code is binding the 
original sys.stdout before Nuke replaces it.

-Nathan

> On Jun 23, 2014, at 12:22 AM, "Johannes Hezer" <j.he...@studiorakete.de> 
> wrote:
> 
> Hm..
> it does work here and I cannot find a difference.
> this is all in a menu.py
> 
> FORMAT = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - 
> %(message)s')
> logging.basicConfig(level=logging.INFO)
> logging.basicConfig(format=FORMAT)
> 
> looks like yours but in more lines ...
> Still I get all loggers into the terminal and the script editor...
> 
> -johannes
> 
> 
> 
>> On 06/23/2014 07:14 AM, 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
>> Sent: Sunday, June 22, 2014 4:22 PM
>> To: Nuke Python discussion
>> 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
>> 
>> -- 
>> <mime-attachment.png>        vfx compositing | workflow customisation and 
>> consulting
>> _______________________________________________
>> 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
>> 
>> 
>> ____ ESET 9928 (20140611) ____
>> The message was checked by ESET Mail Security. 
>> 
>> _______________________________________________
>> 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
>> 
>> 
>> 
>> ____ ESET 9928 (20140611) ____
>> The message was checked by ESET Mail Security.
> 
> 
> -- 
> STUDIO RAKETE GmbH
> Johannes Hezer, Compositing TD & Stereoscopic SV
> Schomburgstr. 120
> D - 22767 Hamburg
> 
> j.he...@studiorakete.de
> Tel:+49 (0)40 - 380 375 69 - 0
> Fax:+49 (0)40 - 380 375 69 - 99
> 
> ------------------------------------------------------
> Pflichtangaben laut Handelsgesetzbuch und GmbH-Gesetz:
> 
> STUDIO RAKETE GmbH
> Schomburgstr. 120 D - 22767 Hamburg
> 
> www.studiorakete.de / i...@studiorakete.de
> 
> Geschaeftsfuehrer: Jana Bohl
> 
> Die Gesellschaft ist eingetragen im Handelregister des
> Amtsgerichts Hamburg unter der Nummer HR B 95660
> USt.-ID Nr.: DE 245787817
> 
> 
> ____ ESET 9928 (20140611) ____
> The message was checked by ESET Mail Security.
> _______________________________________________
> 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
_______________________________________________
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