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 bool ID ## _enabled = true; \
00021 static rlog::PublishLoc ID RLOG_SECTION = {& ID ## _enabled, \
00022 &rlog::RLog_Register, 0, STR(COMPONENT), __FILE__, \
00023 __FUNCTION__, __LINE__, 0};
00024
00025
00026 #if HAVE_PRINTF_FP || !HAVE_PRINTF_ATTR
00027 # define _rMessageCall(ID, CHANNEL, ARGS...) \
00028 if(unlikely(ID ## _enabled)) (*ID.publish)( &ID, CHANNEL, ##ARGS );
00029 #else
00030 # define _rMessageCall(ID, CHANNEL, ARGS...) \
00031 if(unlikely(ID ## _enabled)) \
00032 { \
00033 (*ID.publish)( &ID, CHANNEL, ##ARGS ); \
00034 rlog::__checkArgs( 0, ##ARGS ); \
00035 }
00036 #endif
00037
00038
00039
00040 #define _rMessage(ID, CHANNEL, ARGS... ) \
00041 do { _rMessageDef(ID, RLOG_COMPONENT) \
00042 _rMessageCall(ID, CHANNEL, ##ARGS ) } while(0)
00043
00044
00045 #define rDebug(ARGS...) \
00046 _rMessage( LOGID, rlog::_RLDebugChannel, ##ARGS )
00047
00048 #define rInfo(ARGS...) \
00049 _rMessage( LOGID, rlog::_RLInfoChannel, ##ARGS )
00050
00051 #define rWarning(ARGS...) \
00052 _rMessage( LOGID, rlog::_RLWarningChannel, ##ARGS )
00053
00054 #define rError(ARGS...) \
00055 _rMessage( LOGID, rlog::_RLErrorChannel, ##ARGS )
00056
00057 #define rLog(channel, ARGS...) \
00058 _rMessage( LOGID, channel, ##ARGS )
00059
00060