ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Just one addition to Clemens' post: If you want to access a custom logger, you have to remove the "log4j.logger" part. The following is doing exactly what I want:

log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger("ros.my_package");
if (logger && logger->getLevel() == log4cxx::Level::getDebug()) {
   // debugging code
}

Thanks Clemens, that works!

Just one addition to Clemens' post: If you want to access a custom logger, you have to remove the "log4j.logger" part. The following is doing exactly what I want:

log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger("ros.my_package");
if (logger && logger->getLevel() == log4cxx::Level::getDebug()) {
   // debugging code
}