View Single Post
  #3 (permalink)  
Old 04-11-2008
mefoster mefoster is offline
Registered User
 
Name: Mary Ellen Foster
Organization: Technical University of Munich
Project: JAST human-robot dialogue system
 
Join Date: Jun 2006
Posts: 78
Quote:
Originally Posted by benoit View Post
IceGrid uses the Ice.StdErr and Ice.StdOut properties to redirect the server output. The standard error/output is redirected by the server Ice communicator when it's initialized (with the java.lang.System.setOut/setErr methods). I suspect your prolog JNI library continues to log to the old stdout/stderr instead of using the new standard output/error.
Yes, it looks like that was the issue. Unfortunately, the way this application is written, it's not really practical to use a wrapper -- the main program is actually written prolog, and it initiates the Ice connection through Java after it's done its own initialisation.

For posterity, here's the solution I'm now using to capture all redirected output: after the Ice communicator has been initialised (in Java), I test whether the Ice.StdErr and/or Ice.StdOut properties exist. If they do, then I explicitly redirect the stderr and stdout in Prolog to files with similar names to the Ice files. (I originally thought of just redirecting prolog stdout to the *same* files, but that's probably a recipe for corrupting the output ...)

MEF
__________________
Mary Ellen Foster
Technical University of Munich
JAST human-robot dialogue system
Maintainer of Fedora Ice packages
Reply With Quote