Issue #2 resolved

Redirect sys.stdout to the ingress console

Christopher Toth
created an issue

In the handle method, set self.old_stdout to sys.stdout, set sys.stdout to self.wfile, and watch help() and print and other things start magically start working in the Ingress console. Set sys.stdout = self.old_stdout in the finish method.

Comments (4)

  1. Miki Tebeka repo owner

    Thanks for the suggestion!

    I need to invest some thinking on this one. This changes stdout for the whole process, and I'd like to change it just for the code being executed by ingress.

  2. Christopher Toth reporter

    I'm pretty sure it only changes it for the current thread actually, but could be wrong. I still saw log output to the console, not Ingress when I did this hack, but I'm not sure.

  3. Log in to comment