mrpt_log_macros.h
Go to the documentation of this file.
00001 #ifndef MRPT_BRIDGE_LOG_MACROS_H
00002 #define MRPT_BRIDGE_LOG_MACROS_H
00003 
00004 #define MRPT_VIRTUAL_LOG_MACROS \
00005     protected: virtual void log_debug(const char* format, ...) { \
00006         va_list argptr;\
00007         va_start(argptr, format);\
00008         fprintf(stdout, "DEBUG: ");\
00009         vfprintf(stdout, format, argptr);\
00010         fprintf(stdout, "\n");\
00011         va_end(argptr);\
00012     }\
00013     protected: virtual void log_info(const char* format, ...) { \
00014         va_list argptr;\
00015         va_start(argptr, format);\
00016         fprintf(stdout, "INFO: ");\
00017         vfprintf(stdout, format, argptr);\
00018         fprintf(stdout, "\n");\
00019         va_end(argptr);\
00020     }\
00021     protected: virtual void log_warn(const char* format, ...) {\
00022         va_list argptr;\
00023         va_start(argptr, format);\
00024         fprintf(stderr, "WARNING: ");\
00025         vfprintf(stderr, format, argptr);\
00026         fprintf(stderr, "\n");\
00027         va_end(argptr);\
00028     }\
00029     protected: virtual void log_error(const char* format, ...) {\
00030         va_list argptr;\
00031         va_start(argptr, format);\
00032         fprintf(stderr, "ERROR: ");\
00033         vfprintf(stderr, format, argptr);\
00034         fprintf(stderr, "\n");\
00035         va_end(argptr);\
00036     }\
00037  
00038 #define MRPT_ROS_LOG_MACROS \
00039     protected: virtual void log_debug(const char* format, ...) {\
00040         char buffer[0x1FF];\
00041         va_list argptr;\
00042         va_start(argptr, format);\
00043         vsprintf(buffer, format, argptr);\
00044         ROS_DEBUG("%s",buffer);\
00045         va_end(argptr);\
00046     }\
00047     protected: virtual void log_info(const char* format, ...) {\
00048         char buffer[0x1FF];\
00049         va_list argptr;\
00050         va_start(argptr, format);\
00051         vsprintf(buffer, format, argptr);\
00052         ROS_INFO("%s",buffer);\
00053         va_end(argptr);\
00054     }\
00055     protected: virtual void log_warn(const char* format, ...) {\
00056         char buffer[0x1FF];\
00057         va_list argptr;\
00058         va_start(argptr, format);\
00059         vsprintf(buffer, format, argptr);\
00060         ROS_WARN("%s",buffer);\
00061         va_end(argptr);\
00062     }\
00063     protected: virtual void log_error(const char* format, ...) {\
00064         char buffer[0x1FF];\
00065         va_list argptr;\
00066         va_start(argptr, format);\
00067         vsprintf(buffer, format, argptr);\
00068         ROS_ERROR("%s",buffer);\
00069         va_end(argptr);\
00070     }\
00071 
00072 
00073 #endif //MRPT_BRIDGE_LOG_MACROS_H


mrpt_bridge
Author(s):
autogenerated on Tue Aug 5 2014 10:58:06