2

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).

JRTG
  • 1,654
  • 2
  • 2
  • 11

1 Answers1

3

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.

azeey
  • 411
  • 1
  • 4
  • 8
  • 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. – JRTG Aug 05 '23 at 18:32