00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #define _rMessageDef(ID, COMPONENT) \
00020 static rlog::PublishLoc ID ={&rlog::RLog_Register, 0, STR(COMPONENT), \
00021 __FILE__, __FUNCTION__, __LINE__, 0};
00022
00023
00024 #if HAVE_PRINTF_FP || !HAVE_PRINTF_ATTR
00025 # define _rMessageCall(ID, CHANNEL, ARGS...) \
00026 if(unlikely(ID.publish!=0)) (*ID.publish)( &ID, CHANNEL, ##ARGS );
00027 #else
00028 # define _rMessageCall(ID, CHANNEL, ARGS...) \
00029 if(unlikely(ID.publish!=0)) \
00030 { \
00031 (*ID.publish)( &ID, CHANNEL, ##ARGS ); \
00032 rlog::__checkArgs( 0, ##ARGS ); \
00033 }
00034 #endif
00035
00036
00037
00038 #define _rMessage(ID, CHANNEL, ARGS... ) \
00039 do { _rMessageDef(ID, RLOG_COMPONENT) \
00040 _rMessageCall(ID, CHANNEL, ##ARGS ) } while(0)
00041
00042
00043 #define rDebug(ARGS...) \
00044 _rMessage( LOGID, rlog::_RLDebugChannel, ##ARGS )
00045
00046 #define rInfo(ARGS...) \
00047 _rMessage( LOGID, rlog::_RLInfoChannel, ##ARGS )
00048
00049 #define rWarning(ARGS...) \
00050 _rMessage( LOGID, rlog::_RLWarningChannel, ##ARGS )
00051
00052 #define rError(ARGS...) \
00053 _rMessage( LOGID, rlog::_RLErrorChannel, ##ARGS )
00054
00055 #define rLog(channel, ARGS...) \
00056 _rMessage( LOGID, channel, ##ARGS )
00057
00058