gazebosim / gz-sim

Open source robotics simulator. The latest version of Gazebo.
https://gazebosim.org
Apache License 2.0
664 stars 261 forks source link

Save GUI console logs #962

Open chapulina opened 3 years ago

chapulina commented 3 years ago

Every time a simulation is run, a file is saved in ~/.ignition/gazebo/log/<timestamp>/server_console.log with the console log messages for that run. But the same isn't saved for the GUI process. It would be great to have the logs from the GUI saved as well, so it's easier to go back and search through them.

Desired behavior

Every time a simulation is run with the GUI, the GUI console logs are saved to ~/.ignition/gazebo/log/<timestamp>/gui_console.log

Alternatives considered

Maybe this can be implemented at the ign-gui level? In that case, the logs should probably end up in ~/.igntiion/gui by default, and maybe be configurable by ign-gazebo.

Implementation suggestion

I'd look at how server_console is currently implemented and do the same for the GUI: https://github.com/ignitionrobotics/ign-gazebo/search?q=server_console

Additional context

The log location should respect --record-path

NickNair commented 3 years ago

The logs need to be added from ign-gui/src/ign.cc . Am I right ?

Should I also add a file called ign.cc to the cmd folder in ign-gui/src