ZeroC

Archived

This forum has been archived. Please start a new discussion on GitHub.

Viewing "Print" Output Statements in Ice.py

afcarl
afcarl
How does one enable output of python "print" statements on STDOUT placed in "Ice.py" for diagnostic purposes?
Thanks.

"sys.stdout = sys.__stdout__" does not work.

"print >> sys.__stdout__" does not work either.

"print >> sys.__stderr__" does not work either. ([ python-Bugs-1096310 ] sys.__stdout__ doco isn't discouraging enough)

Comments

  • afcarl
    afcarl
    "sys.__stdout__.write( "..." )" does not work either.
  • joshmoore
    joshmoore Germany
    Hi Andy,

    my guess would be that once the communicator is initialized:
    def initialize(args=None, data=None):
        communicator = IcePy.Communicator(args, data)
        return CommunicatorI(communicator)
    
    the C++ runtime redirects the file descriptors (depending on configuration) and so you won't be able to do much in Python land.

    How are you running the Python servers?
    ~J.