If you write to sys.__stderr__ instead of sys.stderr, it will go to the
original process output.
import loggingimport sys
logger = logging.getLogger('mylogger')
logger.addHandler(logging.StreamHandler(sys.__stderr__))
logger.setLevel(logging.INFO)logger.info("check the terminal")
-Min
On Thu, Aug 3, 2017 at 5:53 AM, Jeff Zhang <[email protected]> wrote:
I try to run the following command, I don't want to display the logging in
> cell, but want to display in the jupyter process output. Is there anyway I
> can do that ? Thanks
>
>
> import logging
> logger = logging.getLogger()
> logger.info("hello world")
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/6850f864-02d0-4ada-9f79-611cfbf35811%40googlegroups.com
> <https://groups.google.com/d/msgid/jupyter/6850f864-02d0-4ada-9f79-611cfbf35811%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
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jupyter/CAHNn8BUDHny186j1y1c9uGAKQFZ7wsZcV3cow3dw1q%2BhHUdvUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.