rosconsole: How to include file and line number in log output
TLDR: How can I include file name and line number in ros logging information that is sent to stdout when launching a node.
It seems like the ROS_LOG
macros would store the file name (__FILE__
) and line number (__LINE__
) from where the ROS_LOG
was used. Is there a way to include that information in the normal output to screen
? I know that I can see it in rqt_console
.
I tried to dig into how rosconsole
uses log4cxx and only found, that log4cxx::Logger::forcedLog(..)
is used to pass the log message to log4cxx where a log4cxx::spi::LocationInfo
object contains the file name and line number. I assume, I'll have to find the log4cxx _layout_ that is used to generate the output printed to screen and somehow change it to make use of the file name and line number.
Could someone please help me to (a) find where this layout needs to be specified and (b) how to set it to include file name and line number?