libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
Macros
AutoLogger

The macro in this Logging module submodule allow simpler management of the loggers. More...

Macros

#define INIT_MOVE3D_LOG(name)   log4cxx::LoggerPtr __move3d_logger__ = logm3d::getLogger(name)
 INIT_MOVE3D_LOG macro creates a logger to be used by AutoLogger macros in the scope where it is called. More...
 
#define MOVE3D_STATIC_LOGGER   static log4cxx::LoggerPtr __move3d_logger__
 MOVE3D_STATIC_LOGGER macro defines a static logger for the class. More...
 
#define INIT_MOVE3D_STATIC_LOGGER(classname, loggername)   log4cxx::LoggerPtr classname::__move3d_logger__ = logm3d::getLogger(loggername)
 INIT_MOVE3D_STATIC_LOGGER() macro is to be called in the class implementation file (.cpp) to instantiate the static logger. More...
 
#define M3D_TRACE(msg)   LOGM3D_TRACE(__move3d_logger__,msg)
 
#define M3D_DEBUG(msg)   LOGM3D_DEBUG(__move3d_logger__,msg)
 Logs a message with the logger defined in the scope with macro of AutoLogger. More...
 
#define M3D_INFO(msg)   LOGM3D_INFO(__move3d_logger__,msg)
 
#define M3D_WARN(msg)   LOGM3D_WARN(__move3d_logger__,msg)
 
#define M3D_ERROR(msg)   LOGM3D_ERROR(__move3d_logger__,msg)
 
#define M3D_FATAL(msg)   LOGM3D_FATAL(__move3d_logger__,msg)
 

Detailed Description

The macro in this Logging module submodule allow simpler management of the loggers.

The M3D_* macro will use a logger defined by a previous call to a INIT_MOVE3D_*LOGGER macro in the scope.

Macro Definition Documentation

#define INIT_MOVE3D_LOG (   name)    log4cxx::LoggerPtr __move3d_logger__ = logm3d::getLogger(name)

INIT_MOVE3D_LOG macro creates a logger to be used by AutoLogger macros in the scope where it is called.

Parameters
nameis the name of the logger, according to log4cxx. e.g. "planners.api.traj" or "planners.hrics.visibility"
Warning
mind the spelling and case of the parents of your logger ("planners", "api", "hrics")
#define INIT_MOVE3D_STATIC_LOGGER (   classname,
  loggername 
)    log4cxx::LoggerPtr classname::__move3d_logger__ = logm3d::getLogger(loggername)

INIT_MOVE3D_STATIC_LOGGER() macro is to be called in the class implementation file (.cpp) to instantiate the static logger.

The static logger has to be defined first with MOVE3D_STATIC_LOGGER macro in the class definition (.h)

#define M3D_DEBUG (   msg)    LOGM3D_DEBUG(__move3d_logger__,msg)

Logs a message with the logger defined in the scope with macro of AutoLogger.

Parameters
[in]msg
#define MOVE3D_STATIC_LOGGER   static log4cxx::LoggerPtr __move3d_logger__

MOVE3D_STATIC_LOGGER macro defines a static logger for the class.

It the has to be initialized (defined) using the INIT_MOVE3D_STATIC_LOGGER