You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OpenSim methods often spew out useful text, but this text does not appear in the MATLAB Command Window; this behavior might surprise users. For example, calling Component::printOutputInfo() would logically display its output in the MATLAB Command Window, but the current behavior is that such output only appears in the out.log file.
Anything printed to standard output (stdout) or standard error (stderr) is lost when a Windows program is running without a console.
Also, the behavior may depend on compatibility between the C runtime library used for MATLAB and OpenSim:
If the library is linked with (built with?) the same or a compatible version of the Microsoft C run-time libraries as MATLAB then you should not need this fix and stdout should be automatically redirected to MATLAB.
We can't rely on such compatibility, since we can't compile OpenSim separately for every possible version of MATLAB our users may have.
One workaround for TGCS is to tell users to just open the out.log file in MATLAB. This is what @carmichaelong has been doing.
@chrisdembia The GUI doesn't do anything special. I vaguely remember (from at least 10 yrs ago) that we created a logger to be accessed from both C++ and Java since streams were not portable cross language. If you look for "logger" you may find some clues if that code is still around 😕
OpenSim methods often spew out useful text, but this text does not appear in the MATLAB Command Window; this behavior might surprise users. For example, calling
Component::printOutputInfo()
would logically display its output in the MATLAB Command Window, but the current behavior is that such output only appears in theout.log
file.This was noted by @carmichaelong and @nickbianco while working on the TGCS example.
From MATLAB Central (https://www.mathworks.com/matlabcentral/answers/102200-how-can-i-capture-stdout-of-a-generic-shared-library-method-called-from-matlab):
Also, the behavior may depend on compatibility between the C runtime library used for MATLAB and OpenSim:
We can't rely on such compatibility, since we can't compile OpenSim separately for every possible version of MATLAB our users may have.
One workaround for TGCS is to tell users to just open the out.log file in MATLAB. This is what @carmichaelong has been doing.
Other relevant links:
The text was updated successfully, but these errors were encountered: