Issue when logging to file: Only some nodes are logged immediately

asked 2018-08-27 07:39:43 -0600

mhe-lorenz gravatar image

I have a number of nodes that I need to configure to log to ~/-ros/log.

All nodes are launched from launch files with output="log". Some nodes logs to the expected file immediately while others are not written until the nodes are closed. The output is written with the rosconsole macros DEBUG, INFO, ERROR, etc. The output is displayed as expected with output="screen" but in the logs with output="log".

Example of launch for functional logging:

<launch>

 <node pkg="connection_link" type="connection_link_client_instance" name="connection_link_client" output="log"> 
     <param name="username" type="string" value="$(env CL_USERNAME)" />
     <param name="password" type="string" value="$(env CL_PASSWORD)" />
     <param name="host" type="string" value="$(env CL_HOST)" />
 </node>

 <node pkg="connection_link" type="connection_link_server_instance" name="connection_link_server" output="log">
      <param name="username" type="string" value="$(env CL_USERNAME)" />
      <param name="password" type="string" value="$(env CL_PASSWORD)" />
      <param name="host" type="string" value="$(env CL_HOST)" />
 </node>

</launch>

Example of launch file for non-functional logging:

<launch>
 <node pkg="fca_core" type="fca_core_node" name="fca_core_node" output="log">
     <param name="fc" type="string" value="$(env FCA_FC)"/>
     <param name="model" type="string" value="$(env FCA_MODEL)"/>
     <param name="battery/voltage/min" type="double" value="$(env FCA_BATTERY_VOLTAGE_MIN)"/>
     <param name="battery/voltage/max" type="double" value="$(env FCA_BATTERY_VOLTAGE_MAX)"/>
 </node>
</launch>

The only particular difference is that some of the nodes have one NodeHandle while others have multiple NodeHandles. The issue seems unrelated to this fact.

Any pointers to probably causes and solution are appreciated!

Ros kinetic 1.12.13 Ubuntu 16.04 on ASUS N552V or Ubuntu Mate 16.04 on a Raspberry Pi 3B

edit retag flag offensive close merge delete