On Sun, Jul 17, 2016 at 5:38 AM oglop <[email protected]> wrote:
>
>
> import logging
> _logger = logging.getLogger('myLogger')
>
> for handler in _logger.handlers:
> _logger.removeHandler(handler)
>
> ch = logging.StreamHandler()
> ch.setLevel(logging.INFO)
> formatter = logging.Formatter('%(name)s:%(levelname)s: %(message)s')
> ch.setFormatter(formatter)
> _logger.addHandler(ch)
> _logger.propagate=0
>
> _logger.info('yeah')
> # myLogger:INFO: yeah
>
> I have set propagate to off already, where does the '#' come from when I
> use _logger in maya 2015?
>
It is because your logging is going to stderr, and Maya assigns a custom
stderr and hides the original one:
import sys
# Maya installs this one so it goes to Script Editor
sys.stderr.write("stderr\n")
# The original one that Maya saves
sys.__stderr__.write("__stderr__\n")
Justin
--
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/c6cf48a7-6e51-4060-b606-d3ab4999a300%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/c6cf48a7-6e51-4060-b606-d3ab4999a300%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2SCCKHqEMuywTb_ffyNns-xAM9E_vf4YdrJbTqoAuqZw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.