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