yarpmanager and stdio tag #206
-
|
Hi, I wrote a simple xml file read by yarpmanager. The file successfully launch the simulator on the node "nodo_valerio" . <application>
<name>Valerio example</name>
<dependencies>
<port>/nodo_valerio</port>
</dependencies>
<module>
<name>iCub_SIM</name>
<parameters></parameters>
<node>nodo_valerio</node>
<stdio>/nodo_valerio</stdio>
<tag>simulator</tag>
</module>
</application>Node was created launching: $ yarprun --server /nodo_valerioNow, I would like to see the console output of the simulator on a console of the same node. |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments
-
|
I honestly don't know whether the Unless you have a particular goal in mind, the latest recommended way to log modules' printouts is through the
Related issues: #170. cc @apaikan |
Beta Was this translation helpful? Give feedback.
-
|
Ok, I'll try. Is there some documentation about yarplogger? The page |
Beta Was this translation helpful? Give feedback.
-
|
Unfortunately, we don't have a proper documentation yet (see robotology/yarp#870). However, from the code, it's quite simple to redirect the output. Just do: #include <yarp/os/LogStream.h>
using namespace yarp::os;
// ...
yInfo()<<"This is a [INFO] message";
yDebug()<<"This is a [DEBUG] message";
yWarning()<<"This is a [WARNING] message";
// ...From the xml you don't have to do anything special; only make sure that the Before launching your application, start the |
Beta Was this translation helpful? Give feedback.
-
|
Ok, thanks for the code, but I guess it is ok only for custom code, where I can insert these lines. How can I do with the iCub_SIM? |
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
mmm... I'm missing something. I did run this test:
The save log file simply display In a second test, if I run the icub_SIM with yarpview module and save the log, I have some info about yarpview: In both cases, no info about the simulator. I think that logger takes only some custom messages (as you suggested), and not the console output. Is it correct? |
Beta Was this translation helpful? Give feedback.
-
|
Well, I ran a quick test on my side with the following simple application: <application>
<name>Test</name>
<dependencies></dependencies>
<module>
<name>iCub_SIM</name>
<dependencies>
<port timeout="20">/yarplogger</port>
</dependencies>
<node>pattacini</node>
</module>
</application>obtaining the attached log_pattacini_iCub_SIM_1752.txt, which pretty much contains all the required info, including unformatted strings. I'm using In particular, what I did was just right-clicking on the log (left panel) to then select the option to save on file. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks! I managed to make it work. What was missing in my xml file was the line in the module description icub_SIM. |
Beta Was this translation helpful? Give feedback.
-
|
Closing the issue :) |
Beta Was this translation helpful? Give feedback.
Well, I ran a quick test on my side with the following simple application:
obtaining the attached log_pattacini_iCub_SIM_1752.txt, which pretty much contains all the required info, including unformatted strings.
I'm using
yarp/develandicub-main/develon a Windows machine.In particular, what I did was just right-clicking on the log (left panel) to then select the option to save on file.