2
$\begingroup$

For testing purposes, I am running Gazebo sim (i.e. 'new Gazebo') with logging enabled:

gz sim -v 4 world.sdf

This works, but there's a lot of irrelevant debug output (e.g. gui, simulationrunner, SystemManager, etc).

Is there a way to filter the log output?

In other words: is there an equivalent command for Gazebo sim, to following ROS 2 command:

ros2 run <package> <executable> --ros-args --log-level DEBUG --log-level rcl:=INFO

which configures loglevel 'debug' for all loggers, except for the rcl logger which gets loglevel 'info' (and hence does not output (many) messages).

$\endgroup$

1 Answer 1

3
$\begingroup$

I believe there's only a global setting (-v 4). One thing that might be useful is that you can run the server and the gui in two separate terminals with gz sim -s -v4 world.sdf and gz sim -g respectively with different verbosity flags.

$\endgroup$
1
  • $\begingroup$ Not the answer I was hoping for, but the suggestion to run in separate terminals is relevant. In the end I resorted to using regular std::cout instead of gzdbg since the white cout output contrasts with the other (colored) messages. Another possibility (which I did not try) could be to use bash color codes in the log messages. $\endgroup$
    – JRTG
    Aug 5, 2023 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.