Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef ROSMATLAB_LOG_H
00030 #define ROSMATLAB_LOG_H
00031
00032 #include <matrix.h>
00033 #include <ros/console.h>
00034
00035 #define ROSMATLAB_PRINTF_PREFIX "[ROS] "
00036
00037 namespace rosmatlab {
00038 namespace log {
00039
00040 using namespace ::ros::console::levels;
00041
00042 void log(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]);
00043 void log(Level level, int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]);
00044 void log(Level level, const char *name, const char *fmt, ...);
00045
00046 }
00047 }
00048
00049 #define ROSMATLAB_PRINTF(...) \
00050 mexPrintf(ROSMATLAB_PRINTF_PREFIX); \
00051 mexPrintf(__VA_ARGS__); \
00052 mexPrintf("\n")
00053
00054 #define ROSMATLAB_DEBUG(...) ::rosmatlab::log::log(::rosmatlab::log::Debug, 0, __VA_ARGS__)
00055 #define ROSMATLAB_INFO(...) ::rosmatlab::log::log(::rosmatlab::log::Info, 0, __VA_ARGS__)
00056 #define ROSMATLAB_WARN(...) ::rosmatlab::log::log(::rosmatlab::log::Warn, 0, __VA_ARGS__)
00057 #define ROSMATLAB_ERROR(...) ::rosmatlab::log::log(::rosmatlab::log::Error, 0, __VA_ARGS__)
00058 #define ROSMATLAB_FATAL(...) ::rosmatlab::log::log(::rosmatlab::log::Fatal, 0, __VA_ARGS__)
00059
00060 #define ROSMATLAB_DEBUG_NAMED(name, ...) ::rosmatlab::log::log(::rosmatlab::log::Debug, name, __VA_ARGS__)
00061 #define ROSMATLAB_INFO_NAMED(name, ...) ::rosmatlab::log::log(::rosmatlab::log::Info, name, __VA_ARGS__)
00062 #define ROSMATLAB_WARN_NAMED(name, ...) ::rosmatlab::log::log(::rosmatlab::log::Warn, name, __VA_ARGS__)
00063 #define ROSMATLAB_ERROR_NAMED(name, ...) ::rosmatlab::log::log(::rosmatlab::log::Error, name, __VA_ARGS__)
00064 #define ROSMATLAB_FATAL_NAMED(name, ...) ::rosmatlab::log::log(::rosmatlab::log::Fatal, name, __VA_ARGS__)
00065
00066 #endif // ROSMATLAB_LOG_H