In the context of looking into implementing a small realtime loop using core ROS 2 functionality (not sure yet if that is a realistic endeavor given current ROS 2 implementation, but anyway), I had the following simple question:
Is it OK to include log macro calls in realtime code, so you can log (non-realtime) during debugging but disable it through the loglevel for normal operation?
I don’t think many people readily know the answer.
So I decided to look through the code and write down my findings.
@clalancette Indeed. My document is rather targeted at understanding the code, whereas the official docs at using it.
Re. adapting the docs: in my ideal world, somebody reads my text, thinks “Hey, I can also contribute!” and takes initiative to adapt the docs where needed. I would do it, but I’ve already rather blown my time budget on this.
But overall, the current logging documentation is ok. My only remarks are:
Default log dir is $ROS_HOME/log, not $ROS_HOME/.log
Rosout logging should be described more in detail, e.g. that this only works for node loggers and not for named loggers etc.
Thanks for your great documentation of the code-walk-through. If you are interested in a real-time Executor itself, you are very welcome to join one of the real-time working group meetings. Your work is very valuable. We are planning to do a similar code-walk-through regarding real-time behavior of the rclcpp-Executor.