19 #include <mrpt/system/datetime.h> 20 #include <mrpt/system/COutputLogger.h> 21 #include <log4cxx/logger.h> 30 log4cxx::LevelPtr lvl)
32 using namespace log4cxx;
35 mrpt::system::VerbosityLevel mrpt_lvl;
37 if (lvl == Level::getFatal() || lvl == Level::getError())
39 mrpt_lvl = mrpt::system::LVL_ERROR;
41 else if (lvl == Level::getWarn())
43 mrpt_lvl = mrpt::system::LVL_WARN;
45 else if (lvl == Level::getInfo())
47 mrpt_lvl = mrpt::system::LVL_INFO;
49 else if (lvl == Level::getDebug() || lvl == Level::getTrace())
51 mrpt_lvl = mrpt::system::LVL_DEBUG;
55 mrpt_lvl = mrpt::system::LVL_INFO;
56 ROS_ERROR(
"Unknown log4cxx::Level is given.");
71 const std::string& msg,
const mrpt::system::VerbosityLevel level,
72 [[maybe_unused]]
const std::string& loggerName,
73 [[maybe_unused]]
const mrpt::system::TTimeStamp timestamp)
76 std::string tmsg = msg;
78 tmsg.compare(tmsg.length() - 1, tmsg.length(),
"\n") == 0)
80 tmsg.erase(tmsg.end() - 1);
85 case mrpt::system::LVL_DEBUG:
88 case mrpt::system::LVL_WARN:
91 case mrpt::system::LVL_ERROR:
95 case mrpt::system::LVL_INFO:
void mrptToROSLoggerCallback(const std::string &msg, const mrpt::system::VerbosityLevel level, [[maybe_unused]] const std::string &loggerName, [[maybe_unused]] const mrpt::system::TTimeStamp timestamp)
callback that is called by MRPT mrpt::system::COuputLogger to redirect log messages to ROS logger...
File includes methods for converting CNetworkOfPoses*DInf <=> NetworkOfPoses message types...
mrpt::system::VerbosityLevel rosLoggerLvlToMRPTLoggerLvl(log4cxx::LevelPtr lvl)
function that converts ROS verbosity level log4cxx::Level to MRPT equivalent MRPT's VerbosityLevel ...